cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PDT2017
Helper I
Helper I

Planner Task Completed & Unique Channel ID

What expression could I use to retrieve a specific channel name based on the trigger “when a planner task is completed”? Both the bucket name and the channel name are the same (also, to note it will be multiple channels within the team). I would like to post a message in the channel once the task is completed.

 

PDT2017_0-1651867611393.png

 

 

  

PDT2017_1-1651867611395.png

 

PDT2017_2-1651867611398.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @PDT2017,

 

In the bucket name 'ID:' is used and in the channel name it is 'ID-'. So, the names of the bucket and channel do not look exactly the same in your screenshots 😅 

 

With this example I would use a filter array to see if the Channel name contains the same ID number which is listed between the round brackets in both the bucket and channel name fields.

 

Below is an example of that approach.

 

1. Add a Filter Array action before the list channels action.

Match the value id of the completed task to Bucket Id of the list buckets action

 

2. Add a second Filter Array action after the list channels.

Match the Channel Name with a contains function to the name of the first bucket found in the previous Filter Array action. I used a couple of split actions to only match on the ID between the round brackets btw. That that expression can be found below:

 

split(split(body('Filter_array_-_Bucket')[0]['name'], 'ID: ')[1], ')')[0]

 

filterarray_actions.PNG



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

3 REPLIES 3
Expiscornovus
Super User
Super User

Hi @PDT2017,

 

In the bucket name 'ID:' is used and in the channel name it is 'ID-'. So, the names of the bucket and channel do not look exactly the same in your screenshots 😅 

 

With this example I would use a filter array to see if the Channel name contains the same ID number which is listed between the round brackets in both the bucket and channel name fields.

 

Below is an example of that approach.

 

1. Add a Filter Array action before the list channels action.

Match the value id of the completed task to Bucket Id of the list buckets action

 

2. Add a second Filter Array action after the list channels.

Match the Channel Name with a contains function to the name of the first bucket found in the previous Filter Array action. I used a couple of split actions to only match on the ID between the round brackets btw. That that expression can be found below:

 

split(split(body('Filter_array_-_Bucket')[0]['name'], 'ID: ')[1], ')')[0]

 

filterarray_actions.PNG



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


PDT2017
Helper I
Helper I

Good eye! I completely missed that. Thank you!!! 

PDT2017
Helper I
Helper I

Hi @Expiscornovus

 

One more question, I needed to retrieve the ID number from the Title, could I use the split/replace for that? or is it possible to remove text? 

 

Thanks for your help! 

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,525)