Hi everyone,
I've built a flow called CSV Attachment to Excel Sync and I'm stuck on an error I can't figure out. Hoping someone here can point me in the right direction.
What the flow is supposed to do:
- Trigger: When a new email arrives (V3)
- List rows present in a table (Excel)
- For each 1 → Delete existing rows
- For each 2 → loop through the email's attachments → Get attachment content
- CSV - Parse to JSON (pdf4me connector) → then sync the parsed data into an Excel table
The problem:
The run fails at the CSV - Parse to JSON step with this error:
Flow run failed. Action 'CSV_-Parse_to_JSON' failed: Unable to process template language expressions in action 'CSV-_Parse_to_JSON' inputs at line '0' and column '0': 'The template language expression body('Get_attachment_content')?['contentBytes'] cannot be evaluated because property 'contentBytes' cannot be selected. Array elements can only be selected using an integer index.'
What I've noticed:
I'm also not seeing any of the CSV file content in the output of the "Get attachment content" step — it doesn't seem to contain the actual file bytes, which makes me think the attachment content isn't being retrieved at all.
What I've already tried / suspect:
- The CSV step uses
body('Get_attachment_content')?['contentBytes'], but the error says this resolves to an array, not a single attachment.
- I'm wondering if the trigger's Include Attachments setting or the choice of attachment action is the root cause.
My questions:
- Is Get attachment content the correct action to retrieve the CSV bytes, or should I be using Get Attachment (V2)?
- Should I reference the current loop item (e.g.
items('For_each_2')?['contentBytes']) instead of the action's body output?
- Do I even need a separate attachment action if Include Attachments = Yes on the trigger?
Any guidance would be much appreciated. Thanks in advance!Hi everyone,