cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SilentUK
Advocate II
Advocate II

Sending Multichoice Sharepoint field in an email

Hi,

I've been trying to crack this for a few days with no luck, hopefully someone here can help!

We have a sharepoint list and a flow that monitors that list and when an item is created, scans this list for anything in a status of "1".  It then grabs these items and emails the details to the specified person.  This is working fine except from one of the coloums which is a multi-choice field. 

I can get it to email the field, but it emails it as JSON instead of plain text which for our managers here is unreadable.  To get around this I tried to store them as a variable and use the Compose trigger with

 

 

 

join(variables('reqRegs'),';')

 

 

 

This works well when there is only 1 item in the list on a status 1, however if multiple items in the list are status 1 it will combine ALL of the multi choice fields of all status 1 items and email that in all the emails.  Does anyone know a way around this?
Screenshot of flow below:

flow 1.PNG

flow2.PNG

I've tried using the parse JSON command as well as a few other suggestions on this forum but none of them will output the way I want.  I'm not fixed in using the compose and variable method if there is something that will work better for my needs.  I've tried using tables, variables etc.  It seems i need to initialise the variable INSIDE the Apply to each loop, however when I try this i get an error saying something along the lines of 'Initialise variable must be created on a top level' which is what I believe is causing the concatenation of all the multiple selections.

Thanks for any help in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
efialttes
Super User
Super User

Hi

"I can get it to email the field, but it emails it as JSON"

Can you post an example of the JSON?

Anyway, I think this thread can give you the answer you are looking for:

https://powerusers.microsoft.com/t5/General-Power-Automate/Read-values-from-multi-selected-choice-co...

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

5 REPLIES 5
efialttes
Super User
Super User

Hi

"I can get it to email the field, but it emails it as JSON"

Can you post an example of the JSON?

Anyway, I think this thread can give you the answer you are looking for:

https://powerusers.microsoft.com/t5/General-Power-Automate/Read-values-from-multi-selected-choice-co...

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Jcook
MVP

Hello @SilentUK

First your variable is fine. Yes you must initialize at top of your flow. Which you can do with blank value. Than use the append to array, like you have done.

My question is: why are there 2 loops?
What happens when you put the Append to array variable inside Apply to each 3.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Thank you for this solution.  It works in emailing the fields now, however when updating multiple items it will now email multiple times.  (I updated 3 items to test and received 9 emails).

 

My flow currently looks like this:

floweg1.PNG

floweg2.PNG

 

It also appears that it is appending all the multi choice selections to the variables, for example one of the items I updated had no multi choice selected, however all the emails contain selections from all previous "apply to each" runs.

 

@Jcook I tried moving where everything was located but it didnt help.  It appears to me that because the variable is declared before the apply to each loop, it just continues to append more strings to it, rather than "resetting" once the Apply to each loop has completed.  Is there a way to "reset" a variable?  if so i believe that would then solve the issue, if the variable emptied itself after each apply to each loop was completed.

 

Hi,

You could reset the variable by using a Set variable action, and putting a Space, and or Null.

Be aware by doing this, if you put the Set Variable inside a loop, you must change concurrency of that loop to 1.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Thank you.  In the end, the original answer worked, I just changed the method I was using to get to the result.  Instead of using a get items with a filter, i'm using a "when an item is created or modified" with a case switch.  This way doesn't append multiple things onto the array.

 

Thank you.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,901)