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 / Getting form attachmen...
Power Automate
Answered

Getting form attachment link as a variable

(0) ShareShare
ReportReport
Posted on by 5

I have created a powerautomate workflow that takes form responses from a form and then sends them as an email. One of the form response fields is an attachment where the user can upload a file.

 

When I try to add this form response to my powerautomate workflow I find that the variable value for the form gives a full string of JSON information rather than the form link itself. Is there a value in powerautomate that will output the form link only, without the rest of the JSON information?

Categories:
I have the same question (0)
  • Verified answer
    Manish Solanki Profile Picture
    15,167 Moderator on at

    Hi @ScottThompsonER 

     

    You need to write an expression to fetch the link of the file uploaded from MS form. Expression needs to be written in the expression box as shown below:

    ManishSolanki_0-1694438681344.png

    first(json(outputs('Get_response_details')?['body/r9b69c1c3a9104afc9921e582d7c3ae73']))?['link']

    pls replace outputs('Get_response_details')?['body/r9b69c1c3a9104afc9921e582d7c3ae73'] with the actual form field in the above expression. This will work if you have allowed only single file for user to upload.

    The output of compose action will give the required link.

     

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

     

    Thanks

     

     

  • ScottThompsonER Profile Picture
    5 on at

    Hey Manish, 

     

    One more question, what can I do to allow this to enter nothing if there are no attachments? The current solution bugs and breaks the flow when there is no JSON attached.

     

    Thanks, 

     

    Scott

  • Manish Solanki Profile Picture
    15,167 Moderator on at

    Hi Scott,

     

    To handle the case when no attachment has been uploaded, pls use the below expression. It will return empty or blank string if no file has been uploaded:

    if(equals(outputs('Get_response_details_2')?['body/rd47769ed20514a3285ceba40cbc92cd4'],''),'',first(json(outputs('Get_response_details_2')?['body/rd47769ed20514a3285ceba40cbc92cd4']))?['link'])

    Pls replace outputs('Get_response_details_2')?['body/rd47769ed20514a3285ceba40cbc92cd4'] with the actual MS form field.

     

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

     

    Thanks

  • munthazir Profile Picture
    6 on at

    This also worked perfectly for me.

     

    But I have a situation, how do I grab the URL if there are 2 attachments?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 103 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 87

#3
trice602 Profile Picture

trice602 63 Super User 2026 Season 1

Last 30 days Overall leaderboard