How would I change a list of things based on a list of ‘unique IDs’?

Hello, I am unable to figure this out but I am sure everyone does it somehow, so any tutorial or info would be appreciated!

Lets say I have 10 items in the database
When user selects that item on the page I add it to a custom state list, so we have it’s unique ID.

In the end we have let’s say 5 items unique IDs in the custom states list.
Then user would click ‘sold’ and the desired outcome would be that those 5 items would get updated in the database, so something like
‘make changes to a list of things that are in our custom states list’

Any tutorial on this would be amazing, this is not the first time I’m getting stuck with this issue, but right now there’s no workaround so I will have to learn it :cowboy_hat_face:

Hi there, @tomajx… if I understand your post correctly, you shouldn’t need to do a search for the list to change. If you simply reference the custom state, you should be good to go. In other words, in the List to change field, select the page/element that contains the custom state and then select the custom state.

Hope this helps.

Best…
Mike

Thank you Mike, but wouldn’t it only change the state of the custom state?
And what we need to do is to actually change those records in the database

No, it would change the actual things stored in the data type. Give it a try and see what happens.

Well damn me, I had no idea it was connected in such a way, thanks Mike! :ok_hand: :ok_hand:

1 Like

I got too excited too quickly… Unfortunately it still doesn’t work
The ‘thing’ I need to change is ‘drives’ , but I am unable to get them to the custom state, because I am using the ‘editable table/excel like’ plugin to display the data.

The only thing I can get to the custom state list is the ‘unique ID’
So the question persists, how would I change a list of things based on a list of ‘unique IDs’?
Hope that makes sense, trying to figure this out for a second day already :roll_eyes:

Thank you in advance!

When we’re talking about Things (custom data types in your database), the unique_id is the Thing in question.

Note that what the plugin author has probably done is just labeled that exposed state in a funny way. However, if they are being stupid and outputting a list of text (string) values instead of a list of the actual Thing data type in question, you can still turn those into the actual Things by simply searching for the Things where the Unique ID is in that list of texts.

in your constraint, try changing the “=” to “is in”

Thank you both for the replies, however there is no such option ‘is in’ in my constrains for the uniqueID thing

This is how I get the uniqueIDs to my custom state list.

===========Edit==========
Just remembered that I have seen similar task done by a backend workflow, it might be better suited for the job, because I also need to check every field of the thing before making changes to it (making sure values are not empty for each row) and I don’t think that’s possible with ‘make changes to a list of things’.
Trying to find a tutorial on that now :roll_eyes:

Finally made it work with help of this tutorial- :ok_hand: :ok_hand: :cowboy_hat_face:

I don’t know that plugin, but in plain Bubble what you’re trying to do is pretty simple…

  • When you create the custom state, create it as the thing itself
  • You can add or delete things from that custom state list
  • In workflow to change the list (changing the things in the database), in the “List to change” box, point it to the custom state
  • If you need to filter that list from the CS, you can add something else to the expression to do that

If the plugin is taking away this simple functionality, I’d contact the developer because it sounds like a bad flaw.