How to Extract URL and add hyperlink from file uploaded in Microsoft form into Excel online by using Power automate

722 Views Asked by At

i have a simple form that have 4 question, that 3 questions need upload file (question 2 is Mandatory) enter image description here

I try to create the flow to save the ms form data to excel online.

enter image description here

How to extract the URL only and make it to hyperlink?

below is my flow: enter image description here enter image description here enter image description hereenter image description here Thank you very much for your help

1

There are 1 best solutions below

2
ChengFeng - MSFT On BEST ANSWER

Here is a test for your reference:

Here is form enter image description here

Here is excel:

enter image description here

Here is flow:

enter image description here

File1 return message:outputs('Get_response_details')?['body/r7cc5c536c5ee45a6bfeb688a5ad2f89c'])

Use json to parse the information returned by file in the Form Then an array will be generated, and then use First to get the first one in the array to avoid using apply to each:

first(json(outputs('Get_response_details')?['body/r7cc5c536c5ee45a6bfeb688a5ad2f89c']))?['id']

The link obtained directly from the file information returned by the form can only be used by yourself. In order for this link to be a shared link, we can create a sharelink through [Create share link]

So we use first(json(outputs('Get_response_details')?['body/r7cc5c536c5ee45a6bfeb688a5ad2f89c']))?['id'] and the last?['id'] This is to get the file ID in parsing

enter image description here

Create share links for other files in the same way

enter image description here

In order to display the link form in excel, we use concat to splice the excel formula to fill in the excel cell.

 concat('=HYPERLINK("',outputs('Create_share_link_for_file_1')?['body/WebUrl'],'"',',','"',first(json(outputs('Get_response_details')?['body/r7cc5c536c5ee45a6bfeb688a5ad2f89c']))?['name'],'")')

enter image description here

Here is test result: enter image description here

enter image description here

enter image description here

enter image description here