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?
This also worked perfectly for me.
But I have a situation, how do I grab the URL if there are 2 attachments?
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
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
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:
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
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional