The solution I tried to implement is to get all of the tasks related to the oppty and store them in a variable. I then loop through them. I then made a decision element and the criteria I chose was to see if the subject on the related tasks in the loop was the same as the task that is being created. If its the same...then I go back to the loop. If the subject is not the same, then I create the task. My logic doesn't appear to be working, though, as duplicate tasks are being created. Thoughts?
1 réponse
Hey Kyle,
The reason there are still duplicate Tasks being created is because for every task that does not have the subject you are checking for, you are creating a new Task. For example, if there are already 5 Tasks on the Opportunity and only 1 has the subject, you are looping through all 5, and for 4 out 5 iterations your decision criteria is evaluating to true and therefore creates a Task.
One solution would be to reconfigure your Loop to have the decision check for a Task that does equal the subject you are looking for and if that evaluates to True, assign any value to a variable. Then after your Loop, check if that variable does not equal your chosen value and you can then create the new Task.
That being said, I believe a more efficient solution would be to choose "Only if the record that triggered the flow to run is updated to meet the condition requirements" for When to Execute Outcome, as that should only create the Task when the specific update you defined are made to Project Detail.
Let me know if that helps or if you'd like some more information.