cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cwshort
New Member

Power Automate - Update Word Document

I currently have a workflow that when a SharePoint list item is created it populates a word template then saves the file in the document library. I would like to take it a step further where if someone updates the list item it would update the document accordingly.  I have looked at templates but have not had any luck. Any help would be appreciated.

 

cwshort_0-1643659729599.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
leyburn19
Memorable Member
Memorable Member

I  just create a new document from the template.  I suppose you could delete document first then create and there would be no name clash.  Pity there is no overwrite capability.

View solution in original post

4 REPLIES 4
leyburn19
Memorable Member
Memorable Member

I  just create a new document from the template.  I suppose you could delete document first then create and there would be no name clash.  Pity there is no overwrite capability.

Thank you. That is what I assumed but thought I would reach out first.

Would I need to create another flow or add to the original? How would I go about doing that and have it delete the original?

 

cwshort_0-1643725641138.png

 

leyburn19
Memorable Member
Memorable Member

Given you need to do a delete you would need to Find the files to delete it.  You would need another flow as the When File Created trigger will not run.  You would need a when file create or modified trigger.  In my case I have a status numeric integer field that when file created is set to 1.  This Flow does all my actions I initially need. 

 

Then when the file is modified my first step is a condition based on the Status.  IF a 1, it does nothing so flow ends (I put a terminate to be sure) .  If another number other than 1,  I have a switch and actions occur based on the number. 

 

Important - In very case the switch action last step sets (update item) the number back to 1 else you end up in a perpetual loop.  I learnt this the hard way with an attachment flow.  Before I realized I had lots of records with over 1000 attachments and climbing 😁 It was a mongrel to fix

 

Now the status number now allows me to do multiple things based on that status field in the one flow.  In your case you would need actions like

 

  1. List Files in Folder (If this gets over 5000 you have other issues)
  2. Condition the loops through point 1.  DisplayName = File name
  3. File location Yes action - File not located No action
  4. Yes Action -
    1. Delete Found File
    2. Recreate Word
    3. May need a delay here to allow system to update
    4. Create File  

 

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,961)