cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jlittlejohn
New Member

Multiple slack msgs sent when using 'Send Slack msg when New Sharepoint List Item Added' flow

Hello, thanks in advance for any assistance.

 

Problem: Duplicate messages are sent to Slack every time I add a new item to a Sharepoint site with multiple choices in a column I am using as a dynamic element.

 

Background: I am using a template flow that sends a msg to slack every time a new item is added to a sharepoint list. The template starts off fine using the [title] element, but if I change the message that is to be displayed in slack and add a [choice] element, then a line is added above the message box and asks to "Select an output from previous steps", which automatically pulls in the choice element. 

- The result is that if I have more than 1 choice selected from the list, the msg is replicate that many times in slack. I only want the message to display ONCE in slack. 

- Even if I remove the choice dynamic element, it still fails every time telling me i need a valid array. I DON'T want it printed multiple times though. 

jlittlejohn_0-1642381276694.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @jlittlejohn,

 

Choice fields which allow multiple values to be selected are also arrays. When using a field of that array it will put your action within an apply to each loop. To workaround this you could use a select action (with Map field in text mode) and only retrieve the Code/Tag value field.

 

With a join function in an expression you turn it into a readable string with , separating the different options.


Below is an example approach for the Code/Tag field.

 

 

 

FYI - New insight added related to *@{join(body('Select'), ', ')}*

 

 

 

selectandjoin.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 @jlittlejohn,

 

Choice fields which allow multiple values to be selected are also arrays. When using a field of that array it will put your action within an apply to each loop. To workaround this you could use a select action (with Map field in text mode) and only retrieve the Code/Tag value field.

 

With a join function in an expression you turn it into a readable string with , separating the different options.


Below is an example approach for the Code/Tag field.

 

 

 

FYI - New insight added related to *@{join(body('Select'), ', ')}*

 

 

 

selectandjoin.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


TYSM @Expiscornovus !

febrilcosme
Frequent Visitor

@Expiscornovus been looking online for our flow that needs to be revised and came across this. We want the slack notifications to be just one instead of multiple notifs. Is this solution also possible for that? Appreciate your help. Thanks

 

https://powerusers.microsoft.com/t5/Using-Flows/Post-Message-to-Slack-compressed-messages-notificati...

 

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 (5,728)