New to bubble, changing items on a list

Hi Community! I am new to bubble and have a question about making changes to items on a list.

I have a list of users, and I would like to change them individually. I would like them to be assigned a value counting up from 1 to “X” and then starting over again. For instance, if X = 4

(Each user has a field called “TempNum” (a number), and that is where I’d like the value to be assigned. )

User 1: 1
User 2: 2
User 3: 3
User 4: 4
User 5: 1
User 6: 2
User 7: 3
User 8: 4
User 9:1

“X” can change.

I am then going to create multiple things and do a search for users with, for instance, 1 as their “tempNum” value.

I tried doing an API “make changes to a list” but that didn’t work.

Does anyone know how to do this?

You could do this when you sign a user up, right?

In the signup workflow, assign TempNum as follows:

Sign up your new user so they exist.

Do a search for Users sorted by Created date (descending):item number 2. (The first item in this list will be the most recently created User - the one u just created. The second item will be the dude or dudette you signed up before THAT.

Now set Current User’s TempNum to the previous User’s TempNum+1 If previous User’s TempNum is < 4. Otherwise, set Current User’s TempNum to 1.

If you already HAVE users that you need to do this assignment for, you could do that as API workflow on a list. (Or just go edit them yourself.)

NOTE: If you use the technique above, you will note that TempNum is ANYTHING BUT temporary! You need to keep that value around on the User so your next User gets assigned the right number, eh?

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.