cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

Put hyperlink to library doc in a list

I have a flow that a generates pdf doc (in a doc library) from a list item. I need to use flow to create a link to the newly created pdf back in the link column in the list. Does anyone know if this is possible?

 

I also need to achieve this without creating a flow loop. I am using 'when an item is created or modified' for my initial flow (below). The flow to create the link only needs to run 'when a document is created' since any updates to the pdf will retain the URL - I think - since the orginal document is being replaced. 
Here's what I have thus far, which creates the docs, just need to get the link generation in.

.1.png2.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate V
Advocate V

Re: Put hyperlink to library doc in a list

Ok. I've figured it out. I am adding the solution in case it helps anyone else. 

My aim was to have flow generate pdf documents using a word document as a template. I also needed flow to put a link to the newly created document back in the list. I could not find a way to create pdf's without first creating a word doc, so I then hid the word versions in the library view. 

 

a.pngb.png

The condition checks to see if the link field is empty. If it is not it, flow will add it. This triggers the flow again, but only the once, since next time round the link field will not be empty and the flow will stop. 

If a user updates the list item again the flow will be triggered, the documents will be updated to capture the changes but the link will not be updated. This is fine because once a document is in situ, any new version will replace it and keep the original url. 

 

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Put hyperlink to library doc in a list

Hi @Victoria ,

 

Do you want to update the link of the file to the corresponding list item?

 

Using the trigger “When an item is created or modified” will cause infinite loop if you have a following “Update item” action to update the same list within the same flow.

 

I suggest add a Condition to check whether the Hyperlink column is empty or not. If it is empty, create the file in the library then update the link to the list item, if it is not empty, do nothing.

 

The function used in the Condition is:

empty(triggerBody()?['ShareLink']) is eqla to True

 

Besides, you need to add action Get file properties before Update item to get the link to the file.

 

Please check the following images for a reference.

1.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advocate V
Advocate V

Re: Put hyperlink to library doc in a list

Hi Mabel,

Thanks for your help. I very much appreciate it. But I'm not sure this is exactly what I need.

The main purpose of this flow is to create word and pdf files in a SP library and do this whenever a user creates or modifies an item in the list.  

Surely if I put the condition in where you suggest my flow will only run when the there is no link present. Won't this stop the flow running completely once a link has been added? There are sure to be subsequent updates in the list but the word docs and pdfs won't get updated.

Can I add the condition further down, so that the action to add the link to doc in library, only happens if this field is empty? I don't need the link to be updated every time a change is made, because the pdf should retain it's original url, once a doc is in situ. 

 

I've tried this.

a.pngb.pngc.pngd.pnge.png

But something is not quite right as my flow is failing on the condition. Something to do with ID I thnk?

g.pngh.pngf.png

Much obliged, Vicki

Highlighted
Advocate V
Advocate V

Re: Put hyperlink to library doc in a list

Ok. I've figured it out. I am adding the solution in case it helps anyone else. 

My aim was to have flow generate pdf documents using a word document as a template. I also needed flow to put a link to the newly created document back in the list. I could not find a way to create pdf's without first creating a word doc, so I then hid the word versions in the library view. 

 

a.pngb.png

The condition checks to see if the link field is empty. If it is not it, flow will add it. This triggers the flow again, but only the once, since next time round the link field will not be empty and the flow will stop. 

If a user updates the list item again the flow will be triggered, the documents will be updated to capture the changes but the link will not be updated. This is fine because once a document is in situ, any new version will replace it and keep the original url. 

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,475)