Listing of the Week

Hello!

Creating a site where I would like to automate the creation of a ’ listing of the week.’

Within my datatype “possible listings”, I have:

  • Field A: user
  • Field B: listing
  • Field C: listing of the week (yes/no)

I would like to create an automated workflow that for every user in Field A, it randomly selects one listing that user is linked to (there will be multiple entries for every user), and switches field C from no to yes. I would like it to happen every Tuesday at 4 PM.

Thank you!!

Run a recursive workflow scheduled every tuesday at 4pm.

Just use the random operator on the list of listings and change the boolean field from no to yes.

If you’re displaying the listing of the week by searching for the listing that has a yes in its boolean field, you would also need to set the previous listing of the week’s boolean field back to no.

Hey @cjmckay15. As @ntabs stated, you will use recursive API workflow. However, to find it for each user, you need to do some more. See the demo below for 5 listing by 2 users:
chrome_SgTQcZHrSL

Simply, the button sends a list of unique users (with a listing) to a backend workflow. And this backend workflow selects the listings of the first user and randomly sets one of the listings to yes, and recursively calls itself for the remaining of the users.

See the details below:

  1. Button sends a list of unique users (with a listing) to the backend workflow:

  2. Backend workflow has a list of users as the parameter obviously. And see the condition in this workflow as well. (it will stop when there is no more users to process).

  3. The first step is updating a random listing of the first user to be the listing of the week.

  4. And then calling the backend workflow again with the remaining users (excluding the first user):
    image

Warning: When you are passing the initial list of users, of course, you might need to change the privacy settings of the user data type. If you don’t want to do that in the frontend, you can also do this in another backend workflow. (getting the list of unique users with a listing and calling the backend workflow I created above).

Here is the editor if you want to play with it and check details: Tests for Forum 13 | Bubble Editor

2 Likes

Thanks for clarifying it further @hergin

You never disappoint us with your detailed examples with GIFs :muscle:

2 Likes

Wow incredible response @hergin. First post on the forum - thanks so much

1 Like