Skip to main content

Notifications

Power Automate - General Discussion
Answered

Attachments that go from FORMS to SHAREPOINT

(0) ShareShare
ReportReport
Posted on by

Hello, I am looking to have any attachment that is added in FORMS to move over to SharePoint, I already have the form set and the flow was working and works at times but sometimes it fails. Not sure what the issue is can someone please advise, thank you.

 

 

Error message 

The execution of template action 'Apply_to_each_attachment' failed: the result of the evaluation of 'foreach' expression '@json(outputs('Get_response_details')?['body/r155b0f7dbb6746efbed08000575884de'])' is of type 'Null'. The result must be a valid array.

 

 

BB818U_0-1714188656808.png

BB818U_1-1714190497227.png

 

  • BB818U Profile Picture
    BB818U on at
    Re: Attachments that go from FORMS to SHAREPOINT

    BB818U_1-1717515287795.png

     

  • BB818U Profile Picture
    BB818U on at
    Re: Attachments that go from FORMS to SHAREPOINT

    Ok it let me input it but it is failing only when I have no attachment 

     

    BB818U_0-1717515246275.png

     

  • Verified answer
    ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: Attachments that go from FORMS to SHAREPOINT

    Hi,

     

    It works for me:

    ManishSolanki_0-1717513629562.png

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • BB818U Profile Picture
    BB818U on at
    Re: Attachments that go from FORMS to SHAREPOINT

    What am I doing wrong here?

     

    BB818U_0-1717513142397.png

     

  • ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: Attachments that go from FORMS to SHAREPOINT

    Please use the below expression:

    if(empty(outputs('Get_response_details')?['body/r155b0f7dbb6746efbed08000575884de']),json('[]'),json(outputs('Get_response_details')?['body/r155b0f7dbb6746efbed08000575884de']))

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • BB818U Profile Picture
    BB818U on at
    Re: Attachments that go from FORMS to SHAREPOINT

    BB818U_0-1717436581128.png

     

  • BB818U Profile Picture
    BB818U on at
    Re: Attachments that go from FORMS to SHAREPOINT

    if(empty(outputs('Get_response_details')?['body/r155b0f7dbb6746efbed08000575884de']),[],json(outputs('Get_response_details')?['body/r155b0f7dbb6746efbed08000575884de']))

     

     

    This is what I have I tried to type each but its not working or pasting 

  • ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: Attachments that go from FORMS to SHAREPOINT

    Pls share the output of get response action from the failed flow instance. I am interested in knowing the values for attachment field in form. You can share the JSON with sample data.

     

     

     

  • BB818U Profile Picture
    BB818U on at
    Re: Attachments that go from FORMS to SHAREPOINT

    I'm getting "THE EXPRESSION IS INVALID" I used your example and updated the field ID, made sure there were no spaces ect. 

  • BB818U Profile Picture
    BB818U on at
    Re: Attachments that go from FORMS to SHAREPOINT

    I'm getting "THE EXPRESSION IS INVALID" I used your example and updated the field ID, made sure there were no spaces ect. 

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard