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.
Solved! Go to Solution.
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'), ', ')}*
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'), ', ')}*
@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