Make change to a thing only editing one row

Hello everyone.

In my application, when a user checks the box and clicks the button, it have to set isClientActive = yes and clientId to current users id

Until here, it worked

But when the user clicks two checkboxes, the conditional only applies to one row of the database. Look:

I’ve selected the first and the last thing of the database . But for some reason, just the last thing had been modified.

Why it happened?

Because you’re running your workflow on a THING and not on a LIST of Things

Hey, @code-escapee. Thanks for helping me.

I’ve applied your tip. but now I need to change only when the checkbox is marked, otherwise, all database info will be fulfilled, and I don’t want this.

My checkbox has a state called isProductChecked (yes/no). I tried to apply an “only when condition” where it will only change the field for the marked checkboxes. For some reason, bubble does not identify the state. Do you think it is a bug?

Usually, the state name has to be on that list, right?

No definitely not a bug. If you want it to do a batch change on a list you have to set a state (list of type MP) somewhere on the page that adds a MP every time a square icon is clicked (and it’s not already in the list) and removes it from the list every time the check icon is clicked - meaning that it is in the list.

  • NOTE you will determine which icon to show based on whether or not the current cell’s MP is within that list.

Then run the API WF on that state (as a list).

I think I didn’t understand well.

I need to store properly the “clientId” and “isClientActive” according to the submission of checked squares, so it will only fill the field IF the user checks the square;

Starting from this, what I have to do is :

  1. set a state list (let’s call MP, as you said) somewhere on the page. I’ve attached it on the square icon, ok?
  2. Adds a MP every time a square icon is clicked

But I have some doubts about it. Sorry I’m a newbie on this topic.

What expression do I use to achieve this output? (that adds a MP every time the square icon is clicked);
And on API workflow, do I have to use “set state”?

If you can, please, send me resources about this topic so I can learn more about it. Thanks, Jacob.