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.
Solved! Go to Solution.
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]
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]
Good eye! I completely missed that. Thank you!!!
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!