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
Dual Super User
Dual 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

View solution in original post

2 REPLIES 2
Expiscornovus
Dual Super User
Dual 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

TYSM @Expiscornovus !

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,366)