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

View solution in original post

2 REPLIES 2
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

TYSM @Expiscornovus !

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (3,698)