Swap User values when 1 is updated?

Hi all! Very new to this, so I hope this isn’t a silly question.

I’ve managed to make a small app where registered users can update their “rank” via an input, and all of the users ranks are displayed in a repeating group.

I want to make it so when someone updates their rank, it swaps values with the previous holder of that rank.

Eg: User B’s rank is 5. User A’s rank is 1. When User B updates their rank to 1, User A’s rank becomes 5 without affecting users with ranks 2, 3, and 4.

Thanks in advance!

Hi @michaeljtaylor07, welcome!

Try this workflow…

When input’s value is changed:

  1. Make a change to a User. User to change = Search for Users :first item. The search has a constraint: rank = input’s value. Change to make: rank = current user’s rank.

  2. Make a change to a User. User to change = Current User. Change to make: rank = input’s value

Step 1 changes User A first, then step 2 changes User B.

Try that. I’m not 100% the order of actions will be honored since Bubble might run them in parallel. If not, you can schedule a custom event to run step 2 to force it to happen after step 1.

Gaby | Coaching Bubble
Private coaching, courses, and tons of free resources

I can’t seem to make that work. I can’t seem to set my workflow that way.

I’ll define my real parameters since this needs more help. Rank is “TagNo” (tag number).

Here is the first workflow I made, so that when they press the Update Tag button, the Current Users TagNo is set to the Input boxes value.

Then I try to set a new change, and tell it to search for a user who’s TagNo is equal to the input boxes value. I get this.

If i click close, the “thing to change” box turns red and it wont give me an option to tell it what to change.

Edit: also, as i continue to try more things, somethings the inputs value isn’t an option. Sometimes it is. I don’t get it.

Edit 2: Figured it out! I didn’t realize that :first item was something i had to set. Once deleted the entire workflow and started from scratch with that in mind, everything fell into place perfectly. Thanks a lot!

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