cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VanillaBear
Regular Visitor

If a task title doesn't match create a new task

I have a 'ticket creation' flow that runs like this.

When a new email arrives, check the subject to see if it contains #VS

If it does not, create a new task, with various updates, the main one being to append #VS and some numbers to the start of the task title.

If the email does contain #VS then I check against all the titles of my current tasks to see if the #VS number matches and if so, I update the description.

However, I want the fall back that if the #VS number DOESN'T match (or it just happens to have #VS in the name) a title, then I want to create a new ticket with a new set of variables.

Currently if I do this, it creates numerous copies of the new ticket for each open ticket I have.

I have seen various similair posts but can't make the resolutions work around my flow.

1 ACCEPTED SOLUTION

Accepted Solutions

@VanillaBear  thanks for the screenshots. I would suggest to do following.

 

1. Add Initialize Variable action in just after the "when new email arrives" trigger (before the condition). Name variable as CreateTask, its type should be boolean and set its value to true from Dynamic Content -> Expressions

annajhaveri_1-1620998216644.png

 

2. Then under the following shown Yes branches add Set variable action and set the value of CreateTask variable and for value select false from the dynamic content - > Expression

 

annajhaveri_2-1620998264142.png

3. Now under the Yes branch of the main condition after the apply to each condition add Condition action. Here in this condition action check value of CreateTask variable to check if its true, then under Yes branch of this condition, add Create task condition. (please note here that you add new condition action after the apply to each action but still the condition should be under the Yes branch of main condition)

 

The issue that you are currently facing that "it creates numerous copies of the new ticket for each open ticket I have.", it is because you are putting Create Task action under the condition which is under the Apply to each action, apply to each action will run X number of times, where X is the number of open tickets. So following above steps will resolve the issue. 

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

10 REPLIES 10
annajhaveri
Super User
Super User

@VanillaBear  can you please share the screenshot of your workflow?

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
VanillaBear
Regular Visitor

Apologies @annajhaveri , last time I tried to insert screenshots I was unable to!

Overview

VanillaBear_1-1620996505616.png

 

Two screenshots for the if Yes expanded

 

VanillaBear_2-1620996593695.pngVanillaBear_3-1620996607836.png

 

 

@VanillaBear  thanks for the screenshots. I would suggest to do following.

 

1. Add Initialize Variable action in just after the "when new email arrives" trigger (before the condition). Name variable as CreateTask, its type should be boolean and set its value to true from Dynamic Content -> Expressions

annajhaveri_1-1620998216644.png

 

2. Then under the following shown Yes branches add Set variable action and set the value of CreateTask variable and for value select false from the dynamic content - > Expression

 

annajhaveri_2-1620998264142.png

3. Now under the Yes branch of the main condition after the apply to each condition add Condition action. Here in this condition action check value of CreateTask variable to check if its true, then under Yes branch of this condition, add Create task condition. (please note here that you add new condition action after the apply to each action but still the condition should be under the Yes branch of main condition)

 

The issue that you are currently facing that "it creates numerous copies of the new ticket for each open ticket I have.", it is because you are putting Create Task action under the condition which is under the Apply to each action, apply to each action will run X number of times, where X is the number of open tickets. So following above steps will resolve the issue. 

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

VanillaBear
Regular Visitor

Hi @annajhaveri , thank you for your help, but you have lost me.

I have added in the initialize variable here 

 

VanillaBear_0-1621002682062.png

 

 

But point 2 and point 3 are confusing me.

 

Can you run through these step by step please?

@VanillaBear  okay lets go step by step, lets first do step 2

 

Under the action "Update task details 2" click on add action button as shown in below screen, and add Set Variable action

 

annajhaveri_0-1621005224338.png

 

The set variable action should look like below

annajhaveri_1-1621005292829.png

 

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Thank you 🙂 That is done!

@VanillaBear  great, for step 3, now do you see Add an Action button under the "Apply to each 2" action, it will appear similar to below screenshot, click on that add an action button and add "Condition" action

 

annajhaveri_0-1621007912808.png

 

Now configure the condition action as shown below:

annajhaveri_1-1621008055396.png

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Thank you! I have done that.

 

So now I just create the task how I would like it to appear under the 'Condition 3' If yes variable?

 

VanillaBear_0-1621008257416.png

 

@VanillaBear  yes thats correct

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Thank you so much for your help! Much appreciated. I will test it out over the weekend!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,683)