Hello all,
I'm working on a flow that is triggered when a new email arrives in a shared mailbox (V2). The email contains a CSV file that I need to parse to JSON Array, but I cannot seem to connect the dynamic content from the CSV file to my flow.
For testing purposes, I pasted what my CSV file would look like in the second step of my flow called 'Compose CSV'. In the further steps, I've followed up on the output from Compose CSV to convert the csv data into Array.
I got this to work, but I'm stuck now that I want to use the dynamic content from the e-mail. I've tried to replace the expression: @{split(outputs('Compose_(CSV)'),outputs('NewLine'))} by referring to the trigger output: @{split(outputs(triggerOutputs()?['body/attachments']),outputs('NewLine'))} but I get an InvalidTemplate
Which dynamic content do I need to use to get my flow to work from emailed csv data? And is it correct that I can change the input of the split expression for this to work? Or do I need to change my flow? See picture for my current flow. Let me know if I need to clarify something. I am quite new to building these kinds of flows so any help would be appreciated.
Hi @Anonymous ,
Please check this link:Power Automate: How to parse a CSV File to create a JSON array (tachytelic.net)
I did a test for your reference.
In my scenario:
base64ToString(outputs('Get_Attachment_(V2)')?['body/contentBytes'])
split(outputs('Compose'), decodeUriComponent('%0D%0A'))
skip(outputs('splitNewLine'),1)
split(item(), ',')
outputs('splitByComma')?[0]
outputs('splitByComma')?[1]
My CSV File Content:
Best Regards,
Sunshine Gu
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2