Array Type Flow Variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 09:40 PM
HI,
I want to create an array type variable so I can iterate these later on in a for each. But it seems there's no avaiable array type in flow designer.
Any workaround for this? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 07:33 PM
Hi @Kirby R,
I feel your pain here, as I've run into this many times where I am thinking programmatically, and the best solution would have been to store data in an array, to use later in the flow.
So far, the best I have been able to come up with is to use a string flow variable. Then each action where you would "add to the array", you instead simply add to the string with comma separation (e.g., "one,two,three,four").
You'll need to handle the first element differently to additional elements. If you don't mind more scripting, you can script the input to the flow variable to check if it already has content, then add a comma + your new value, otherwise just set the content to be the new value. Alternatively, you can do that check in the flow, making use of the flow logic If and Else actions (this method adds extra actions to the flow, but prevents issues with broken action references if you move actions around).
Then, when you want to work with that comma-separated string, you can make use of a custom flow action, that takes in a string, and outputs an array of strings, making use of the split(",") function in the script. This will give you the array that you can then run through a for each loop. Otherwise, you could also just ensure your later actions accept comma-separated strings if appropriate.
Good luck!
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 10:21 AM - edited 07-09-2024 10:23 AM
Just like this one
var cfDemandTask = fd_data.flow_var.cf_demand_task;
if(cfDemandTask == ''){
cfDemandTask = fd_data._4__create_task.record.sys_id;
} else {
cfDemandTask = cfDemandTask + "," + fd_data._4__create_task.record.sys_id;
}
return cfDemandTask;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 07:20 AM
Hello,
Any solution to this issue?
Thanks!
Best,
Firat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 11:25 AM
I created an idea for this -- really frustrating.