CSV - Parse to JSON fails with "contentBytes cannot be selected" — attachment content missing from Get attachment content

James Riaz 0 Reputation points
2026-07-05T16:19:18.36+00:00

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:

  1. Trigger: When a new email arrives (V3)
  2. List rows present in a table (Excel)
  3. For each 1 → Delete existing rows
  4. For each 2 → loop through the email's attachments → Get attachment content
  5. 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:

  1. Is Get attachment content the correct action to retrieve the CSV bytes, or should I be using Get Attachment (V2)?
  2. Should I reference the current loop item (e.g. items('For_each_2')?['contentBytes']) instead of the action's body output?
  3. 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,

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:

  1. Trigger: When a new email arrives (V3)
  2. List rows present in a table (Excel)
  3. For each 1 → Delete existing rows
  4. For each 2 → loop through the email's attachments → Get attachment content
  5. 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:

  1. Is Get attachment content the correct action to retrieve the CSV bytes, or should I be using Get Attachment (V2)?
  2. Should I reference the current loop item (e.g. items('For_each_2')?['contentBytes']) instead of the action's body output?
  3. Do I even need a separate attachment action if Include Attachments = Yes on the trigger?

Any guidance would be much appreciated. Thanks in advance!

This question is related to the following Learning Module

Microsoft 365 and Office | Excel | For business | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Darren-Ng 11,855 Reputation points Microsoft External Staff Moderator
    2026-07-05T23:40:56.48+00:00

    Dear @James Riaz,

    Thank you for posting your question in the Microsoft Q&A forum.Based on your description, this issue appears to be related to a Power Automate flow design and expression evaluation rather than a CSV or Excel-specific problem. The error suggests that the output being passed to the CSV - Parse to JSON action may be an array, while the expression is attempting to access it as a single object.

    Since Power Automate flow configuration, expressions, loops, and connector-specific behavior are best handled by Power Platform specialists, I recommend posting your question in the Power Automate Community forum, where experts can review your flow design and run history in more detail: Microsoft Power Platform Community Forum Thread

    When creating your post, it would be helpful to include:

    • Screenshots of the flow design
    • The configuration of the Get attachment content action
    • The expression used in CSV - Parse to JSON
    • The output (or run history) of the failed actions
    • Whether the issue occurs with a single attachment or multiple attachments

    This information will help the Power Automate community provide more targeted guidance.

    I truly apologies for redirecting you to a different community as the members of the posted category focus on users with Microsoft 365 concern and have limited knowledge about Power Automate, so to get a quick and better assistance, I redirect you in the correct way.  

    I appreciate your patience and understanding and thank you for your time and cooperation.  

    Please feel free to reach out if you have any other questions.


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.