01-26-2021 06:24 AM - last edited 01-26-2021 06:38 AM
Formatting a CSV file in MS flows is tedious as there is no standard provided connector which can help is transforming a CSV to HTML and use it for sending in email (or further operations). Unless we go for Premium connectors available.
Here is the flow which can be used to convert a CSV to HTML and use it further for Sending inline in email.
Logic of the Flow is:
1. Get the CSV file (from SharePoint Or OneDrive or Gateway)
2. Read contents of the CSV file by Split each row of the CSV data and save it in Array (named EACH_ROW)
3. Compose the CSS, Table tags and assimilate it with #2 each row variable (EACH_ROW)
4. process the EACH_ROW variable by,
5. Now, concatenate the CSS variable (of step # 3) with the HTML data obtained at the end of step # 4. Alternatively, CSS can be part of 'Send Email' with the body having output from last step of Step # 4
This processes the CSV file and transforms it into HTML table. Attached is the sample CSV file and screenshots of the flow. If your CSV file differs then accordingly, you can find the pattern in the CSV file and build a HTML table using above logic.
CSS applied by me was to include Color coding for the header (1st row) of the HTML table.
Please feel free to reach out to me for more details and if any help needed, would be glad to help!
Thanks!