cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kmayes
Post Prodigy
Post Prodigy

Create CSV TABLE

Hi Community

 

I am creating a CSV table in flow and using dynamic content from SP list however when the column is a selection column is applies all the Odata whereas i just want the value. I applied the expression as follows item()?['ColumnName/Value'] but this hasn't resolved this. Can anyone correct my expression?

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @Kmayes,

 

In that case you can use xpath to retrieve the value properties of that nested array, which that choice column (with allow multiple selection enable) will be.

 

Kudos to @tom_riha for this solution approach and if you want to read more about this approach btw:

https://tomriha.com/export-multiple-person-or-group-column-into-csv-table-in-power-automate/

 

In your case the expression would be:

 

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

 

 

createcsv_xpath.png

The CSV output will be something like this:

 

Date,ColumnName
2021-09-16 00:00:00Z,"B, C"
No date,"A, B"

 

 

View solution in original post

4 REPLIES 4
Expiscornovus
Super User
Super User

Hi @Kmayes,

 

Just to double check. Does your choice column allow multiple selections?

 

allowmultipleseletions_screenshot.png

@Expiscornovus 

 

Hi @Expiscornovus 

 

Yes (doubted myself for a minute) it does 🙂

Kmayes_0-1631277880812.png

 

Expiscornovus
Super User
Super User

Hi @Kmayes,

 

In that case you can use xpath to retrieve the value properties of that nested array, which that choice column (with allow multiple selection enable) will be.

 

Kudos to @tom_riha for this solution approach and if you want to read more about this approach btw:

https://tomriha.com/export-multiple-person-or-group-column-into-csv-table-in-power-automate/

 

In your case the expression would be:

 

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

 

 

createcsv_xpath.png

The CSV output will be something like this:

 

Date,ColumnName
2021-09-16 00:00:00Z,"B, C"
No date,"A, B"

 

 

View solution in original post

@Expiscornovus 

 

That works a treat and also thanks a million for sending the link to how that is achieved as very useful 😉

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,505)