cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AKB_2K
Resolver I
Resolver I

Pulling filtered row of SharePoint list containing multiple choice columns and sending it via email using HTML table

Hello Everyone,

 

I have created a PowerApps which is displaying list of items from a SharePoint List in a gallery. PowerApps page has multiple filters which the user can select to filter the SharePoint data. Now after filtering the data on PowerApps, user wants to send the data to their email from PowerApps itself as 

1. Filtered data in form of a HTML table in email body

2. Filtered data as a CSV attachment

 

I have successfully created the PowerApps and Flow to retrieve the filtered data from SharePoint directly using the following steps.

1. User clicks on "Email" button on PowerApps

2. PowerApps passes the "Odata query" along with "user email address" and "email subject" to PowerAutomate flow.

3. Flow retrieves the information based on Odata query, creates the HTML table containing multiple rows and columns, creates CSV file with same data, attaches the CSV and triggers the email.

 

Problem I am facing here is with multiple choice columns, which are a few in this list. For each row of the HTML table and CSV file, that multiple choice SharePoint column value appears with odata tag for each row of values. For e.g.

 

ID

Status

Application(s) Impacted

1

Medium

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

2

Critical

[{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":2,"Value":"Value 2"}],[{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"Value 3"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":2,"Value":"Value 5"}],

 

 

and so on...

 

Ideally I would like the HTML email and CSV data to be displayed as 

ID

Status

Application(s) Impacted

1

Medium

Value 1

2

Critical

Value 2, Value 3, Value 5

 

Can someone help me how to achieve this?

1 ACCEPTED SOLUTION

Accepted Solutions
AKB_2K
Resolver I
Resolver I

Just wanted to update that I found the solution to this piece from this blog. 

Format multiple choice SharePoint column in .csv using Power Automate 

 

This interesting piece of code worked perfectly!

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

View solution in original post

1 REPLY 1
AKB_2K
Resolver I
Resolver I

Just wanted to update that I found the solution to this piece from this blog. 

Format multiple choice SharePoint column in .csv using Power Automate 

 

This interesting piece of code worked perfectly!

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

Helpful resources

Announcements
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.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (1,822)