Forum Academy Marketplace Showcase Pricing Features

Iterating Multiple Lists

Hi there,
I have an app that’s used a workflow system for my company, and I’m working on a workflow to assign a list of Orders to a User in a list of available Users (based on backlog and such).

I basically want to iterate through a list of Orders and rotating through a list of Users. Something like this for three available Users:

Order 1----->User 1
Order2----->User2
Order3 ---->User3
Order4---->User1
Order5---->User2
Order6---->User3
Order7----->User1
…and so on

I currently have a Backend Workflow that successfully assigns the list of Orders randomly (Order’s Songwriter=Search for Users:randomitem), but I’m needing to figure out how to normalize the process and am a bit stumped.

Any ideas?

I think you would have to do a sort of recursive backend workflow. For example “Schedule API Workflow” (not on a list). And set up the api workflow like pictured below:


Screen Shot 2022-01-27 at 4.33.04 PM
Screen Shot 2022-01-27 at 4.33.16 PM
Screen Shot 2022-01-27 at 4.33.26 PM

Notice both times you will want to only re run the workflow if the list still has items in it and each time you pass the list of orders minus the first item, which should be the item you make changes to. Then you want to account for whether you have reached the end of your list of users to start back at user item# 1 again. This will run through the workflow and process one order at a time assigning it to a different user in orer.

2 Likes

Ah, thanks so much, William! You just blew my mind a bit with that recursive workflow, I haven’t experienced or heard of them before. Just the amount of flexibility I needed.
Much appreciated!

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