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

Notifications

Announcements

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
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 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

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard