Hello,
I have built this flow to export a SharePoint list to a CSV file whilst also converting 3 columns that have HTML formatting to plain text. The flow runs OK however only the SharePoint columns are being generated into the list but not the 'HTML to Text' columns.
As you can see from the generated file, the rows are duplicated and only showing one of the items from the SharePoint list.
This should be showing every item from the SharePoint list.
Flow details:
@grantjenkins this solution works great.
I have one last question, which from my tinkering is proving a nightmare to acheieve.
I also need to save the list item attachments into a folder - DONE, but also want to reference the attachment names in the list CSV file - any idea on how I could achieve this?
Thanks!
@grantjenkins this looks superb!
I’ll be trying this tomorrow at work! 🙂
@sudosaurus Sorry for the delay in getting back to you. I had a play with different fields (Hyperlink, Multiline Text [Plain Text], Multiline Text [Rich Text], etc.) and found that you only need to cater for the Rich Text fields.
The way you had your flow structured; it would have created a separate file for each iteration since Create file is within your Apply to each.
For this example, I'm using the following list.
See full flow below. I'll go into each of the actions.
Get items retrieves all the list items.
Initialize variable creates a variable called data of type Array. This will eventually contain our objects we want to use as final output.
Apply to each iterates over each of the items retrieved.
Html to text HTML and Html to text HTMLV2 remove the HTML formatting from our two Rich Text columns.
Append to array variable builds up an object with the fields we want in our CSV table and appends it to the data variable.
{
"Company": @{items('Apply_to_each')?['Title']},
"Account Manager": @{items('Apply_to_each')?['AccountManager']},
"URL": @{items('Apply_to_each')?['URL']},
"HTML": @{body('Html_to_text_HTML')},
"HTMLV2": @{body('Html_to_text_HTMLV2')}
}
After the Apply to each we use Create CSV table using the data array as input.
Create file uses the output from Create CSV table to create our CSV file.
After running the flow I'd get the following CSV file. I had to resize the rows/columns to see all the data.
----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.
Here's a sample of the SharePoint list
The three HTML to Text actions are converting correctly:
As you can see it's doing one record at a time in the 'Apply to each' action.
But only adding one of the items in the list to the final document that is produced.
Here's the 'Select' inputs and outputs:
When you run your flow can you look at the output you get from each of the Html to text actions. Or have a look at the output in your Select to see if you're getting any data for those within there at least.
Also, if possible, show a sample of your SharePoint List.
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1