Subflow Action - create task for every Script return value

Meloper
Kilo Sage

Is there an action in a subworkflow
to generate Return X tasks depending on the script?

I have to check at the beginning of the flow via script if 1 or more tasks have to be created.
Return would be an array or multiple objects.

For each of these return values I want to create a task.
But not in script but " properly" as a flow action.

Is this possible

1 ACCEPTED SOLUTION

Soeren Maucher
Mega Sage

Hello @Meloper

 

yes, in general that would be possible. Your action/script would have to provide an array as an output (e.g. an array of objects): 

SoerenMaucher_0-1674810824666.png

Then with a for each logic in Flow Designer you can loop over all those objects and create a task in each loop execution using already existing flow actions like "create record". 

I am not sure about your script logic, but I would try to replace this with low code logic as well e.g. "lookup records" action can typically be used to create an array of multiple objects. Then you can avoid scripting at all and dont have to deal with creating the array output via script which can be quite difficult. 

 

I hope this helped. If yes, I would appreciate if you could mark this answer as "correct solution". Thank you!

 

Greetings, 
Sören

 

View solution in original post

6 REPLIES 6

can we use lookup records action to go through  a Multiline Variable Set?

Hello @Meloper

 

going through a Multi-Row Variable Set is even easier than that. In my opinion, it works very well together with Flow Designer. You can directly take the Multi-Row Variable Set and use the for each logic on it (no Lookup Records action required). 

See following Screenshots: 
1. Use the Action "Get catalog variables" in Flow Designer to retrieve your  Multi-Row Variable Set.

SoerenMaucher_1-1674825604942.png

2. Insert for each logic and drag and drop your multi row variable set

SoerenMaucher_2-1674825674752.png


You can find more information regarding that in my Best Practice article on Catalog Items (Best Practice number 4). https://www.linkedin.com/pulse/5-catalog-item-best-practices-follow-s%25C3%25B6ren-maucher/?tracking...

 

If you think my answers are useful, I would appreciate if you could mark my answers as helpful / correct solution. Thank you!

Greetings,
Sören