web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow failing at get th...
Power Automate
Answered

Flow failing at get the attachment section

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I'm getting this error:

 

Unable to process template language expressions for action 'Apply_to_each-_SP_Attach' at line '1' and column '83072': 'The template language expression 'body('Get_attachments')?['body']' cannot be evaluated because property 'body' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

 

I've used the 'id' in 'Get attachments' and 'get attachment content' from ask in PowerApps.

 

DanielRK_0-1617191478154.png

 

More detail= here:

 

DanielRK_1-1617191483657.png

 

'DisplayName' is: 

DanielRK_2-1617191641755.png

 

'$Content' is:

DanielRK_3-1617191677162.png

 

Have I written the expressions wrong?

 

Thanks again for your help!

 

Regards,

 

Daniel

 

 

Categories:
  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @Anonymous 

     

    Please use below:

    Display Name:

     

    items('LoopName')?['DisplayName']

     

    Content

     

    outputs('Get_attachment_content')?['body']

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Mira_Ghaly ,

     

    Thank you for your swift answer. Here's failing on the apply to each loop. From what I can tell it's saying it wants and integer index but I don't know what this is or how to solve it.

     

    DanielRK_0-1617192650906.png

     

    The trigger of the flow is a powerapp button and the users can attach attachments in the powerapps. The datasource is Sharepoint online.

     

    Also, the attachment being called is the one captured in the powerapps on the submission of the form.

     

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @Anonymous 

    I have the same flow , Can you please open the Get Attachments from History and check the raw outputs

    Mira_Ghaly_0-1617193456031.png

     

  • Verified answer
    Mira Ghaly Profile Picture
    11,415 Moderator on at

    @Anonymous 

     

    Try Passing below expression to your array Input

    Mira_Ghaly_0-1617193731825.png

     

    outputs('Get_attachments')?['body']
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Mira_Ghaly ,

     

    I tried the expressions you said but I get the same result.

     

    DanielRK_0-1617195036574.png

     

     

    I did check the raw outputs of the get attachments file and there is only one attachment.

     

    Do I have to add something after ?['body'] in the expression like the ID?

     

    So like this ?['body']?['ID'] or am I wrong?

     

    Thank you again.

     

    Regards,

     

    Dan

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Mira_Ghaly ,

     

    Thank you so much! It worked!.

     

    Regards,

     

    Daniel

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard