Sort decision table results

kchorny
Tera Guru

I have a decision table that takes two inputs and returns Short description, Description and Assignment group of one or more tasks (custom table). The decision table also has an integer output to define which order to create the tasks in. 

 

I have a flow defined that is triggered by the insertion of the parent record (custom table). The inputs from the parent record are sent to the decision table and the task details are returned. However, I can find no way to sort the results so that the tasks are created in the defined order.

 

kchorny_0-1721922630105.png

 

 

Any ideas how I might achieve this requirement?

3 REPLIES 3

lynnrogers
Tera Expert

Did you find a solution for this? I've got a similar problem.

Nope, not yet. 😞

Vusi Baloyi
Tera Contributor

Hi @kchorny 

Here is how I got around this, may not be the best way but it works.

 

It was requested items in my case.

1.  You have your decision table with task order

VusiBaloyi_0-1747513638679.png

2.  In your flow, set 2 variables as below,

VusiBaloyi_1-1747513788736.png

Here is the code for the count : 

VusiBaloyi_4-1747558095676.png

 

Now you know how many tasks you have and an index to keep track of where you are.

 

3. In your flow, get the task details using index as input *(remember to wait for completion on your tasks)

VusiBaloyi_1-1747555567252.png

 and increase the index after processing each task.

 

4. Add a condition to terminate your loop.

VusiBaloyi_2-1747555918524.png

 

Please ensure to check how this affects performance.