cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ndeangelo1
Regular Visitor

Return values of multi-choice Sharepoint field in an email

Hi, 

I have a list that contains a field called Product, which is a choice field, allows multiple selections.  I want to email users each time a new item is added to the list.  I've created a variable in my Flow/Automate that captures the Product selections and appends to get all the values selected - unfortunately it looks like this: 

Product: {"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"ChoiceA"}

{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"ChoiceB"}

{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":2,"Value":"ChoiceC"}

How do I get just ChoiceA, ChoiceB, ChoiceC out of all of this?

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Most Valuable Professional
Most Valuable Professional

@ndeangelo1 

If your choice column is called Product, you should refer to Product Value in Dynamic properties for your append to string action.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

16 REPLIES 16
ScottShearer
Most Valuable Professional
Most Valuable Professional

@ndeangelo1 

Please see my example below and let me know if you have any questions.  In my example, I have a choice column called MultiChoice that allows for multiple selections.  When referring to an individual choice value you refer to the column name followed by "Value" in Dynamic properties.

Multi1.jpgMulti2.jpgMulti4.jpgMulti3.jpg

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
ndeangelo1
Regular Visitor

Hi Scott, 

Thanks - I'm following you down to the part where I do the Compose and Skip function - after that I"m not sure what to do?  

ScottShearer
Most Valuable Professional
Most Valuable Professional

@ndeangelo1 

My understanding is that you want to send an email.  Place your Send an email action immediately after the compose action.  Reference the output of the Compose action (along with the values of other columns if you want) in the email.

image.png

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

on my example, when I look at Dynamic Content for the email, I"m not seeing an "output" from the Compose function.  Did I miss something there?pick.jpg

 

ScottShearer
Most Valuable Professional
Most Valuable Professional

@ndeangelo1 

Please move the compose action outside of and below your loop and give it a try.  If you are still having issues, please post a screen shot of your Flow and include the expression you have in your Compose action.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

It's still just giving me the same values - here's my Flow - pick2.jpg

ScottShearer
Most Valuable Professional
Most Valuable Professional

@ndeangelo1 

Can you please post the following

  • Expand your initialize variable action and post a screen shot
  • Expand you Append to string action and post a screen shot
  • A screen shot of the expression used in your compose action

Also please verify that you are referencing the entry in the choice column followed by Value from Dynamic properties.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

I believe everything you asked for is here:pick3.jpg

Here's what the email returns:  

Product:


{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Vendor Security Questionnaire (VSQ)"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"PreAssessment Report"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":2,"Value":"Initial Risk Profile (IRP)"}

Vendor: test vendor

 

ScottShearer
Most Valuable Professional
Most Valuable Professional

@ndeangelo1 

If your choice column is called Product, you should refer to Product Value in Dynamic properties for your append to string action.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

everything is working!  except for the "Skip" function seems to have zero effect on the items.  The comma still shows up - and I've tested changing the integer from 1 to 2 to 26 and it has no impact on the final result of the variable.  If I can't get that working, I can certainly live with this!!!  Thank you.

You have to take item "Outputs" of action compose2 instead of the variable you worked with ...

Hi Scott,
Thank you for sharing the steps - this is super helpful for me to display values in a multi-choice field in email.  Really appreciate you sharing these steps.  

Anonymous
Not applicable

Hi @ScottShearer, Thank you for this solution! You really helped me.

Hi @ScottShearer thanks so much for this solution, this had me stuck for a while now!

 

Can you help me refine the skip function as i cannot get it to strip out the first comma when adding the variable to an email? I had tried playing with the count as others had mentioned on the thread but i cannot get it to work and it adds the ", multivalue1,multivalue2" in the subject line when adding that variable output

 

Here is my expression:  skip(variables('MultiCat'),1)

 

Thank you in advance

mpsalian
New Member

try this and let me know
so my Odata structure is like this 


[
{
"@odata.etag": "\"1\"",
"ItemInternalId": "2",
"ID": 2,
"Title": "Test2",
"Category0": [
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "Design"
}
],
"Category0@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference)",
"Category0#Id": [
1
],
"Category0#Id@odata.type": "#Collection(Int64)",
"Progress": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "In progress"
},
"Progress#Id": 1,
"Priority": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "High"
}

]

To get the value of category i would iterate like this 

 

join(xpath(xml(json(concat('{"body":{"value":', item()?['Category0'] , '}}'))), '/body/value/Value/text()'), ', ')

 

Try and let me know @ndeangelo1 

@mpsalian  - This is a great answer and works perfect for scenarios in which we do not want to loop through the choice column.

 

For example, I created a filtered collection of SharePoint items through the Get Items step. 

gebhardd_0-1686586945364.png


My goal is to export details of these items to a CSV file; however, if we attempt to export the data straight from the Get Items step, we receive the full object(s) as seen in the below screenshot of Cost Center 1 and 2.

gebhardd_2-1686587824990.png

 

Using the Select step, we can pick what fields we want to export, but we do not want to loop through all the SharePoint items and Cost Center choices.  Thankfully, using this solution, all we have to do is place this formula in map value.

gebhardd_3-1686588732650.png

 

When we export the data, we get exactly the values we want.

 

gebhardd_4-1686588905250.png

 

Thanks again! 

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (3,353)