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

How to *not* Apply to each plan when posting in Teams chat?

Hello, I'm new to Power Automate and the purpose of the flow below is to automatically post a message in the general Teams chat once a Planner to-do item is checked off as complete and notifying the next task owner:

 

tcannafax_0-1669745645511.png

tcannafax_1-1669744547561.png

 

The flow works, however it is posting the message across all plan checklists in the Team, which shouldn't happen because it's misleading and I can't figure out how to proceed without the Apply to each flow automatically inserting itself. For example, I checked off a task from the 5678 plan, but a chat notification still posted for the 6374 plan even though nothing was technically checked off from that plan list:

tcannafax_2-1669744778538.png

 

Any ideas on how I can adapt the flow to only apply the message for the indicated plan (5678)? Thank you for your help. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
David_MA
Impactful Individual
Impactful Individual

Okay, that was not in your original screen shot. In that case do this and you should be all set. I tested it and it works for me:

  1. After your list plans for a group action, initialize a string variable, which I named Plan Name
  2. Follow this with a filter array action
    1. From will be the value from the List plans action
    2. The filter will be where the value ID is equal to the Plan Id from the task completed action
    3. Use the body of the filter array in the apply to each and set the variable Plan Name with the Title from the filter
    4. You can then use the variable in your Teams channel post action.

David_MA_0-1669751366478.png

 

View solution in original post

6 REPLIES 6
ChristianAbata
Super User
Super User

@tcannafax pleas check your filter array action. You are comparing an id that maeby is not unique that's why you got more than one response



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
David_MA
Impactful Individual
Impactful Individual

Maybe I am missing something... Except for the Get an at mentions token action, why do you need all of the actions between When a task is completed and Post message in a chat or channel? You are specifying which channel to post to in the Teams action, so just this should work for you:

pwcapture.jpg

Hi @David_MA , some of those other steps were suggested by another user to make sure the Plan ID displays properly in the subject line of the chat post. I previously tried the flow below (what you suggested), using Plan Id in the subject line instead of Title:

tcannafax_0-1669747433791.png

 

But when I do this, I get gibberish in the subject line:

tcannafax_1-1669747529073.png

 

I don't want to use the Title tag again, because it will just repeat the name of the task title, not the plan title: 

tcannafax_2-1669747613671.png

 

If there's another suggestion for fixing that piece without Apply to each, I'll gladly try it. Thank you!

David_MA
Impactful Individual
Impactful Individual

The plan ID is included in the action When a task is completed. You should be able to use that in the Teams action.

David_MA
Impactful Individual
Impactful Individual

Okay, that was not in your original screen shot. In that case do this and you should be all set. I tested it and it works for me:

  1. After your list plans for a group action, initialize a string variable, which I named Plan Name
  2. Follow this with a filter array action
    1. From will be the value from the List plans action
    2. The filter will be where the value ID is equal to the Plan Id from the task completed action
    3. Use the body of the filter array in the apply to each and set the variable Plan Name with the Title from the filter
    4. You can then use the variable in your Teams channel post action.

David_MA_0-1669751366478.png

 

@David_MA this worked, thank you so much!!! We'll soon be working off of 5 different plans concurrently, so this issue was causing me major anxiety 😅 Much appreciated!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,157)