- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 01:26 PM
Our team has a Choice field on a table, with numbers 1-10. When a user selects a number from that Choice field and submits, we would like to trigger flow designer to create that many records on our case table. We know that there is a For Each flow logic action, but looks like it wouldn't work with our Choice field. We realize we can likely script a Business Rule to accomplish this, but wanted to know if this is possible in Flow Designer.
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 07:15 PM
Hi davilu,
You could use the Do the following until flow logic. One solution would be to save the value from the choice list as a flow variable, and then decrement the value every time you create a record/case. This would mimic the standard for or while loops in Javascript:
The above flow sets a value for the flow variable (I called it Choice in mine). Within the Do the following block I i) create a record and ii) decrement the Choice variable by 1 using a transform function:
The block repeats until the value of my Choice variable is 0.
So perhaps a smidgen more than:
var i = 0;
while (i < 5) {
// do something;
i++;
}
...but you have your no-code alternative in a flow.
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 07:15 PM
Hi davilu,
You could use the Do the following until flow logic. One solution would be to save the value from the choice list as a flow variable, and then decrement the value every time you create a record/case. This would mimic the standard for or while loops in Javascript:
The above flow sets a value for the flow variable (I called it Choice in mine). Within the Do the following block I i) create a record and ii) decrement the Choice variable by 1 using a transform function:
The block repeats until the value of my Choice variable is 0.
So perhaps a smidgen more than:
var i = 0;
while (i < 5) {
// do something;
i++;
}
...but you have your no-code alternative in a flow.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2022 02:37 PM
Thanks this worked like a charm!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 01:35 AM
Hi Jason Nichols,
On the first set flow variable what is the value that you are setting? I also have this similar use case.
In a record producer there is variable number_of_client_ids (choice field), based on this choice looping should done (If the user selects 3 in that choice means looping should be done thrice).
But the problem here is If I am creating a flow variable I have to pass this choice dynamically, but the data pill in flow variable is not accepting the data type choice

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2022 07:03 PM
Hi Krithika,
I was able to set the flow variable from the catalog variable.
In my catalog item, the variable was a Select Box type. In my Set Flow Variables step, I am able to use the catalog variable data pill:
When ordering the item, the flow variable value is set to the value from the catalog variable (in the example below, 2😞