Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Creating a flow in Flow Designer with field values and tasks

rdskn023ET
Tera Contributor

Hi,

 

I am looking to get some assistance in Flow Designer when using a field value and completion of demand tasks to perform specific steps. Below is an example. Any assistance you can provide would be appreciated!

 

Field A has the values 1, 2 and 3. 

When Field A is selected with value 1, I need to create two specific demand tasks. Upon completion of those two demand tasks, I need to automatically set Field A to 2, which then creates two new specific demand tasks. The same will happen for Field A value 3. 

 

That part is easy when it is linear, but the complexity comes when we open up Field A to be selected in any order. Therefore, someone could select 2 in Field A first, which would create the two demand tasks. Once those two demand tasks gets closed out, it would set Field A to 3 and create two new demand tasks. I need to ensure that this functionality works in any order without duplicate demand tasks being created. So a user could select 3 in Field A, then 2 in Field A and then 3 in Field A again, but only have total of four demand tasks created, two for Field A's 2 value and two for Field A's 3 value. Then, at any point they could select Field A's 1 value and have those demand tasks created, again, without any duplication if they were to select a different value and go back and select 1 again. Therefore, regardless of the number of times they selected a different number from the field, there would only be a total of six demand tasks created in any scenario.

 

I hope this makes sense. Basically, the overall picture is to create a flow where a group of actions/tasks could be created in any order without duplicates based on a field's value and/or the completion of those tasks that were created. 

 

Thanks in advance for any assistance. 

6 REPLIES 6

Mark Manders
Mega Patron

You could trigger the flow on change of field a. Depending on the choice, the tasks are created (linear, with if/else conditions). Make sure your tasks are somehow recognizable as the field A value, so you can do a check before creation of the tasks (if field changes to 2, do a look up to the tasks to see if the '2' tasks are already there or not). Or maybe prevent the choice on Demand level (hide the choice, based on the previous selection). 
I am wondering about that automation thingy. You say 'after 1, it moves to 2 and then to 3', but what is the automation when 3 is chosen? Or is it always all three after 1, 2 and 3 after 2 and 3 as single choice when chosen first and then manual adjustment?
Because then you should add an update to the value after 'changes to 1' and 'changes to 2' triggers, to update the field.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Thanks Mark. The automation occurs only after 1 and 2. They want an automation flow starting from 1 to 3, but have the freedom to modify a field and have the same functionality occur. I had a flow created that was working for the most part, but seemed a little complex for what was needing to be accomplished. The trigger was set to run when demand was created or updated, along with a few specific details of the demand. The part I wasn't 100% sure of was the run trigger item, i.e. once, if not currently running, for every update, etc.. Wasn't sure which would be most suitable since it would not be a linear flow, but didn't want it running too often being a complex flow. 

 

My setup was something similar to:

-if Field A = 1

--then lookup records where demand task name is 'demand task 1' and 'demand task 2' and parent sys id = trigger sys_id

---if count is 0

----then create demand tasks

-----wait for condition -demand tasks are closed

---Else

----for each record in the previous lookup

----wait for condition - all demand tasks are closed

---Update demand - Field A to 2

Then I would create a similar If statement for 2 and 3. 

 

Just not sure if this is the most efficient way to handle it. As for the automation once it hits 3 and all tasks would be completed, I would actually have another option in the dropdown 'Completed', which would be the option to occur once all 3 items have been completed. I can accomplish that portion, just setting up the 1,2 and 3 items, along with the run trigger option is the part I want to make sure I am being most efficient on. 

Thoughts?

 

Thanks!

anurampalli
Tera Contributor

hi @rdskn023ET 

 

What is the trigger in this scenario? Is it a Catalog Item with the field (Field A)? Or is it a Record Created/Updated trigger?

 

Does the following help, at all?

Assuming your trigger is “Record Created/Updated”, did you select “Run Once”?

Can you identify tasks for a particular record for a particular value for Field A?

You could try this approach:

  1. Read the value of Field A (1, 2, or 3).

  2. Before creating tasks, check whether the tasks for that number already exist.

  3. If Field A = 1: create tasks for 1 if they don’t exist. If Tasks for this record for value 1 for Field A exist, exit the flow.

  4. If Field A = 2: create tasks for 1 (if they don't exist) and then for 2 if they don't exist. Wait for created tasks to finish and exit the flow. If flow didn't create any tasks, just exit the flow.

  5. If Field A = 3: create tasks for 1, 2, and 3, again only if they don't exist.

  6. Wait for the tasks of the current number to complete, then update Field A to the next number as needed.

This way, users can select numbers in any order, tasks won’t be duplicated, and Field A only progresses once the relevant tasks are closed.

Hi,

 

Thanks for your input.

 

Currently, it is set to trigger on Record created or updated. I am also using Field A in a 'changed as' trigger condition. I am running into situations where I am seeing duplicates, but only because I am using the run trigger option of 'For each unique change'. I cannot use the run trigger 'only if not currently running', as when Field A is at 3, it will not advance back to 2 or 1 based on the flow from top to bottom. 

 

In your scenario, my question would be if it is set to only run once, how would Field A ever automatically advance from 1 to 2 and 2 to 3 once the tasks are complete? If I understand your flow setup, if Field A is equal to 1, then it will check to see if the tasks exist. If they do not, then create them and end the flow. If they do exist, then end the flow. I see how this would prevent duplicates, but not understanding how the auto advance of Field A would happen in this case, which is a requirement being asked for. 

 

I am open to other methods of auto advancing Field A's value, if one exists.


Thanks!