cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Check if a Planner Task exists

I'm definitely new to Flow, but I looked around and haven't seen this yet.

 

I'd like to generate a Task in Microsoft Planner based on emails that come in. That part is fairly straightforward. The issue I'm bumping up against is discovering if a task already exists.

 

I'd like to look through my tasks and check the title (or body) for the "Conversation Id" of the email. If a task with that Conversation Id doesn't exist, then I'd like to create a new one. If such a task DOES exist, I'd like to append the new email text to the Task Description (or maybe add a new comment).

If it comes right down to it, my issue is checking a container for a matching item. I'm just struggling with the "conditions" and "apply to each" (couldn't we just have a "get a match" for different container types?) flow items.

Thanks!

16 REPLIES 16
v-bacao-msft
Community Support
Community Support

Hi @Anonymous,

 

Do you want to use Conversation Id as a basis for judging whether a task exists?

Then I think you need to use Conversation Id as part of the task title, or as a title.

I did a test on my side, please take a try with the following workaround:

   Use the list tasks to get all the tasks, then configure Condition to determine if the task already exists. It is based on whether the title contains Conversation Id.

   If it is included, first use Html to text to get the content of the email body, then use Get task details to get the description of the task, and configure the output corresponding to the above action in the description field.

  If it does not, create a new task with the title containing Conversation Id.

Image reference:

48.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Barry,

 

Thank you! That's exactly what I needed! I was getting closer to this with trial and error, but your example is exactly what I needed!

 

As far as Conversation Id, I wasn't sure if that was the title of the email, or a unique, underlying identifier. I wasn't sure whether it would be small (and could be put in the Task Title) or large (and should be included in the Task Description).

 

Thanks again, for your help!

Hi @Anonymous,

 

Sorry, there is still a problem with the design of this Flow. I found that there is a problem with the logic for judging whether the planner already exists later.

If this is configured, it will create a lot of duplicate tasks.

I have improved on the basis of the previous, as below:

58.PNG59.PNG60.PNG

Please take a try again and feel free let me know if you have any question.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Barry,

 

Yeah, I noticed that issue. I was trying a bunch of idifferent variable manipulations (which I obviously don't quite understand), but was never quite able to eliminate the duplicates - this was mainly because I had trouble updating details immediately after creating the task (it couldn't find the task 1 step after it was created).

 

Your solution has not revealed a critical step: what is your "condition" at the bottom of the first picture?
And if you can share it, would you mind explaining, in detail, what is happening with your Select and your condition?
(I feel like I can read it, but I haven't been able to come up with the working arrangement yet, so obviously I'm missing a detail or two.)

 

N.B.
The Title probably isn't a great place for the Convo Id: it's a rather long string, and Title is a rather short string.

Thanks again!
Toni

Hi @Anonymous,

 

My mistakes, the screenshots do not seem to be fully presented. I made a change to the location of Conversation Id. If you don't configure it in the Title, you could put it in Description.

It was also made some changes on the basis of the original.

Adding a step is to get the existing Task Description, save it in a String variable, and then determine whether the String contains Conversation Id that in the mail.

If it contains, update Description; if it does not, create a new Task, now you could configure the content you want to configure in Title, followed by update Description, you need to configure the Conversation Id.

The only thing that is unsatisfactory is that if Conversation Id is configured in Description, the execution time of Flow will be longer. Because Description cannot be obtained directly through List tasks.

Image reference:

Overall configuration:

24.PNG

 

Save all Task Description:

25.PNG

Determine if the Task already exists:

26.PNG

Please take a try again.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Barry,

 

Thanks again for all your help - it definitely looks like we're getting closer!

Your example definitely seems to cover some new ground for me, but I think I need to create an array that extracts the Task Id, with the Description. Right now (if I'm reading it correctly), you should be updating the last task added to your AllTaskDescription string - not the task that correlates with the conversation Id. Unfortunately, I haven't figured out how to lookup a Task by TaskId...

 

Thanks,

Toni

Hello!

 

Script anyway creating duplicate items...

Hello @v-bacao-msft

I attempted to use this solution for a similar problem I was having. For each existing task that does not match the conversation id a new task is created. This logically makes sense but it is not ideal. I would like for only 1 task to be created if all existing task titles do not contain the conversation id.

 

Thanks in advance!

Hello,

Really good explanation, a question is there in any way possible to limit the number of tasks which are retrieved from Planner?

 

We have alot of tasks in our planner which are done.  

@v-bacao-msft thanks for this, it's providing us with a pretty reasonable ticketing system via. Planner in Teams which is great!

 

For some reason it appears to be running the flow on every ticket in the plan, so in my case creating 65 new tasks (we're using an existing plan with tasks on for testing purposes).

 

After running a second time, it updated 1 task, then created 64 new ones, so the create / update functions are working.

 

I think I need to filter the array produced with the data operation somehow, which I think is what you posted in your second update, but after trying that I'm still getting the same result.

 

Any thoughts?

 

Cheers,

 

KB

Shtroupfette
Frequent Visitor

Good day,

 

I was able to make it work by Initializing a variable of the Title of the tasks 

1- verify if the Subject is in the Value of Tasks if not create a new one if so

2- set the variable ok the Title and validate if the Title match the Subject

 

 

Capture d’écran, le 2021-01-25 à 15.50.07.png

 

RicGer
New Member

my approach to solve the issue in three steps:

-  CreateTitle: Create a unique title to identify individual tasks

-  SearchTask: Filter Array of Tasks based on unique title (Title eq outputs('CreateTitle')

-  CountTasks: Count matching tasks… length(body('SearchTask'))

... shoud be 0 (does not exist) or >0 (minumum of 1 task exist... you may decide further steps with duplicate tasks)

ghazi
New Member

The solution is to loop through tasks. First, initialise a boolean variable (fCreateNew) as true. Then loop through each existing task. If the task exists (and is not completed), update it and set fCreateNew to false. At the end, if fCreateNew is still true, create the new task.

 

(Other solutions create a task for each task that doesn't match the description, so be careful implementing them! I had a hard time deleting all the created tasks!)

 

In my example here, I am create a new task based on an email arriving to a shared folder:

 

ghazi_0-1617172059452.png

Here is the new boolean variable:

 

ghazi_1-1617172099720.png

 

This part will update any task that matches the description AND is not yet complete

ghazi_2-1617172177957.png

 

The variable above is set as follows:

ghazi_3-1617172275289.png

 

After every task has been looped through, if fCreateNew is still true, then a new task can be created as follows:

 

ghazi_4-1617172337708.png

 

Hope this helps!

 

Anonymous
Not applicable

The solution of @ghazi works perfect for me!

 

the only problem I'm running into now is that I can't refer a task to a person.

Does anyone have a genius solution to solve this?

Thanks for this - a simple, clever solution to the problem I had here (basically the same as the OP, but with buckets rather than tasks).

I tried this and I still get unended tasks created.  I'm adding it to a code where it pulls the attachments if they exist.

helpwithautomat_0-1646889429901.png

helpwithautomat_1-1646889467219.png

helpwithautomat_2-1646889508233.png

 

Helpful resources

Announcements

Power Platform Connections Ep 15 | L. Baybutt | Thursday, 1 June 2023

Episode Fifteen of Power Platform Connections sees David Warner and Hugo Bernier talk to Microsoft MVP Lewis Baybutt aka Low Code Lewis, alongside the latest news and community blogs.   Use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show.        Action requested: Feel free to provide feedback on how we can make our community more inclusive and diverse.  This episode premiers live on our YouTube at 12pm PST on Thursday 1st June 2023.  Video series available at Power Platform Community YouTube channel.    Upcoming events:  European Power Platform conference – Jun. 20-22nd - Dublin Microsoft Power Platform Conference – Oct. 3-5th - Las Vegas  Join our Communities:  Power Apps Community Power Automate Community Power Virtual Agents Community Power Pages Community  If you’d like to hear from a specific community member in an upcoming recording and/or have specific questions for the Power Platform Connections team, please let us know. We will do our best to address all your requests or questions.  Action requested: Feel free to provide feedback on how we can make our community more inclusive and diverse.  This episode premiers live on our YouTube at 12pm PST on Thursday 1st June 2023.  Video series available at Power Platform Community YouTube channel.    Upcoming events:  European Power Platform conference – Jun. 20-22nd - Dublin Microsoft Power Platform Conference – Oct. 3-5th - Las Vegas  Join our Communities:  Power Apps Community Power Automate Community Power Virtual Agents Community Power Pages Community  If you’d like to hear from a specific community member in an upcoming recording and/or have specific questions for the Power Platform Connections team, please let us know. We will do our best to address all your requests or questions. 

May 2023 Community Newsletter and Upcoming Events

Welcome to our May 2023 Community Newsletter, where we'll be highlighting the latest news, releases, upcoming events, and the great work of our members inside the Biz Apps communities. If you're new to this LinkedIn group, be sure to subscribe here in the News & Announcements to stay up to date with the latest news from our ever-growing membership network who "changed the way they thought about code".         LATEST NEWS "Mondays at Microsoft" LIVE on LinkedIn - 8am PST - Monday 15th May  - Grab your Monday morning coffee and come join Principal Program Managers Heather Cook and Karuana Gatimu for the premiere episode of "Mondays at Microsoft"! This show will kick off the launch of the new Microsoft Community LinkedIn channel and cover a whole host of hot topics from across the #PowerPlatform, #ModernWork, #Dynamics365, #AI, and everything in-between. Just click the image below to register and come join the team LIVE on Monday 15th May 2023 at 8am PST. Hope to see you there!     Executive Keynote | Microsoft Customer Success Day CVP for Business Applications & Platform, Charles Lamanna, shares the latest #BusinessApplications product enhancements and updates to help customers achieve their business outcomes.         S01E13 Power Platform Connections - 12pm PST - Thursday 11th May Episode Thirteen of Power Platform Connections sees Hugo Bernier take a deep dive into the mind of co-host David Warner II, alongside the reviewing the great work of Dennis Goedegebuure, Keith Atherton, Michael Megel, Cat Schneider, and more. Click below to subscribe and get notified, with David and Hugo LIVE in the YouTube chat from 12pm PST. And use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show.         UPCOMING EVENTS   European Power Platform Conference - early bird ticket sale ends! The European Power Platform Conference early bird ticket sale ends on Friday 12th May 2023! #EPPC23 brings together the Microsoft Power Platform Communities for three days of unrivaled days in-person learning, connections and inspiration, featuring three inspirational keynotes, six expert full-day tutorials, and over eighty-five specialist sessions, with guest speakers including April Dunnam, Dona Sarkar, Ilya Fainberg, Janet Robb, Daniel Laskewitz, Rui Santos, Jens Christian Schrøder, Marco Rocca, and many more. Deep dive into the latest product advancements as you hear from some of the brightest minds in the #PowerApps space. Click here to book your ticket today and save!      DynamicMinds Conference - Slovenia - 22-24th May 2023 It's not long now until the DynamicsMinds Conference, which takes place in Slovenia on 22nd - 24th May, 2023 - where brilliant minds meet, mingle & share! This great Power Platform and Dynamics 365 Conference features a whole host of amazing speakers, including the likes of Georg Glantschnig, Dona Sarkar, Tommy Skaue, Monique Hayward, Aleksandar Totovic, Rachel Profitt, Aurélien CLERE, Ana Inés Urrutia de Souza, Luca Pellegrini, Bostjan Golob, Shannon Mullins, Elena Baeva, Ivan Ficko, Guro Faller, Vivian Voss, Andrew Bibby, Tricia Sinclair, Roger Gilchrist, Sara Lagerquist, Steve Mordue, and many more. Click here: DynamicsMinds Conference for more info on what is sure an amazing community conference covering all aspects of Power Platform and beyond.    Days of Knowledge Conference in Denmark - 1-2nd June 2023 Check out 'Days of Knowledge', a Directions 4 Partners conference on 1st-2nd June in Odense, Denmark, which focuses on educating employees, sharing knowledge and upgrading Business Central professionals. This fantastic two-day conference offers a combination of training sessions and workshops - all with Business Central and related products as the main topic. There's a great list of industry experts sharing their knowledge, including Iona V., Bert Verbeek, Liza Juhlin, Douglas Romão, Carolina Edvinsson, Kim Dalsgaard Christensen, Inga Sartauskaite, Peik Bech-Andersen, Shannon Mullins, James Crowter, Mona Borksted Nielsen, Renato Fajdiga, Vivian Voss, Sven Noomen, Paulien Buskens, Andri Már Helgason, Kayleen Hannigan, Freddy Kristiansen, Signe Agerbo, Luc van Vugt, and many more. If you want to meet industry experts, gain an advantage in the SMB-market, and acquire new knowledge about Microsoft Dynamics Business Central, click here Days of Knowledge Conference in Denmark to buy your ticket today!   COMMUNITY HIGHLIGHTS Check out our top Super and Community Users reaching new levels! These hardworking members are posting, answering questions, kudos, and providing top solutions in their communities.   Power Apps:  Super Users: @WarrenBelz, @LaurensM  @BCBuizer  Community Users:  @Amik@ @mmollet, @Cr1t    Power Automate:  Super Users: @Expiscornovus , @grantjenkins, @abm  Community Users: @Nived_Nambiar, @ManishSolanki    Power Virtual Agents:  Super Users: @Pstork1, @Expiscornovus  Community Users: @JoseA, @fernandosilva, @angerfire1213    Power Pages: Super Users: @ragavanrajan  Community Users: @Fubar, @Madhankumar_L,@gospa  LATEST COMMUNITY BLOG ARTICLES  Power Apps Community Blog  Power Automate Community Blog  Power Virtual Agents Community Blog  Power Pages Community Blog  Check out 'Using the Community' for more helpful tips and information:  Power Apps , Power Automate, Power Virtual Agents, Power Pages 

Announcing | Super Users - 2023 Season 1

Super Users – 2023 Season 1    We are excited to kick off the Power Users Super User Program for 2023 - Season 1.  The Power Platform Super Users have done an amazing job in keeping the Power Platform communities helpful, accurate and responsive. We would like to send these amazing folks a big THANK YOU for their efforts.      Super User Season 1 | Contributions July 1, 2022 – December 31, 2022  Super User Season 2 | Contributions January 1, 2023 – June 30, 2023    Curious what a Super User is? Super Users are especially active community members who are eager to help others with their community questions. There are 2 Super User seasons in a year, and we monitor the community for new potential Super Users at the end of each season. Super Users are recognized in the community with both a rank name and icon next to their username, and a seasonal badge on their profile.  Power Apps  Power Automate  Power Virtual Agents  Power Pages  Pstork1*  Pstork1*  Pstork1*  OliverRodrigues  BCBuizer  Expiscornovus*  Expiscornovus*  ragavanrajan  AhmedSalih  grantjenkins  renatoromao    Mira_Ghaly*  Mira_Ghaly*      Sundeep_Malik*  Sundeep_Malik*      SudeepGhatakNZ*  SudeepGhatakNZ*      StretchFredrik*  StretchFredrik*      365-Assist*  365-Assist*      cha_cha  ekarim2020      timl  Hardesh15      iAm_ManCat  annajhaveri      SebS  Rhiassuring      LaurensM  abm      TheRobRush  Ankesh_49      WiZey  lbendlin      Nogueira1306  Kaif_Siddique      victorcp  RobElliott      dpoggemann  srduval      SBax  CFernandes      Roverandom  schwibach      Akser  CraigStewart      PowerRanger  MichaelAnnis      subsguts  David_MA      EricRegnier  edgonzales      zmansuri  GeorgiosG      ChrisPiasecki  ryule      AmDev  fchopo      phipps0218  tom_riha      theapurva  takolota     Akash17  momlo     BCLS776  Shuvam-rpa     rampprakash  ScottShearer     Rusk  ChristianAbata     cchannon  Koen5     a33ik  Heartholme     AaronKnox  okeks      Matren  David_MA     Alex_10        Jeff_Thorpe        poweractivate        Ramole        DianaBirkelbach        DavidZoon        AJ_Z        PriyankaGeethik        BrianS        StalinPonnusamy        HamidBee        CNT        Anonymous_Hippo        Anchov        KeithAtherton        alaabitar        Tolu_Victor        KRider        sperry1625        IPC_ahaas      zuurg    rubin_boer   cwebb365   Dorrinda   G1124   Gabibalaban   Manan-Malhotra   jcfDaniel   WarrenBelz   Waegemma   drrickryp   GuidoPreite   metsshan    If an * is at the end of a user's name this means they are a Multi Super User, in more than one community. Please note this is not the final list, as we are pending a few acceptances.  Once they are received the list will be updated. 

Check out the new Power Platform Communities Front Door Experience!

We are excited to share the ‘Power Platform Communities Front Door’ experience with you!   Front Door brings together content from all the Power Platform communities into a single place for our community members, customers and low-code, no-code enthusiasts to learn, share and engage with peers, advocates, community program managers and our product team members. There are a host of features and new capabilities now available on Power Platform Communities Front Door to make content more discoverable for all power product community users which includes ForumsUser GroupsEventsCommunity highlightsCommunity by numbersLinks to all communities Users can see top discussions from across all the Power Platform communities and easily navigate to the latest or trending posts for further interaction. Additionally, they can filter to individual products as well.   Users can filter and browse the user group events from all power platform products with feature parity to existing community user group experience and added filtering capabilities.     Users can now explore user groups on the Power Platform Front Door landing page with capability to view all products in Power Platform.      Explore Power Platform Communities Front Door today. Visit Power Platform Community Front door to easily navigate to the different product communities, view a roll up of user groups, events and forums.

Microsoft Power Platform Conference | Registration Open | Oct. 3-5 2023

We are so excited to see you for the Microsoft Power Platform Conference in Las Vegas October 3-5 2023! But first, let's take a look back at some fun moments and the best community in tech from MPPC 2022 in Orlando, Florida.   Featuring guest speakers such as Charles Lamanna, Heather Cook, Julie Strauss, Nirav Shah, Ryan Cunningham, Sangya Singh, Stephen Siciliano, Hugo Bernier and many more.   Register today: https://www.powerplatformconf.com/   

Users online (2,567)