Hello. I'm new to PA. I have created a Word template where after I fill in fields in a sharepoint form it uses Power Automate to generate a .docx and then convert to the pdf and those are created in a sharepoint library. My flow works until that point. I now need to add a delete action to delete all of the word docs and allow the pdf docs to stay in the library by themselves. The name of the file is dynamic, so the first part is always the name of the user taken from the "full name" field of the form and then "Driving record authorization.pdf comes after that (below). Both create file fields are the same (one for the doc x and one for the pdf)
The delete action doesn't work with that syntax and throws an error that it is not in a json format (below is the setup).
I then went back to the drawing board again with new info and pasted the info into a encodeuricomponent field, but it throws the error "the expression is invalid". The code is encodeUriComponent(/Driving Record Forms/outputs('Get_response_details')?['body/r52e0be9f78e541bcb6b0ec6a785ad325']/Driving Record Authorization.docx). I'm not sure the syntax is correct with the above code.
To sum it up, I have a library that has 2 documents created with the same name from a form, but I need to delete the dynamically named word docs after they are used to convert to the pdf. I thought this would be easy, but it has turned out to be the hardest part. Any pointers in the right direction would be appreciated.
Solved! Go to Solution.
Thank you for posting.
According to your description, You want to delete the docx file in one folder and only save PDF file with the same name. If any misunderstanding, please kindly let me know.
Please select the 'Id' from 'Create file' in File identfier and try again
Hope the content above may help you.
Best Regards
If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for posting.
According to your description, You want to delete the docx file in one folder and only save PDF file with the same name. If any misunderstanding, please kindly let me know.
Please select the 'Id' from 'Create file' in File identfier and try again
Hope the content above may help you.
Best Regards
If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello. That got me close. It deleted the PDF and kept the word doc. So I switched the delete file action to be in between the "convert word document to pdf" and the "create file 2" action and it deleted the previous word document created with the "create file" action. Thanks for your help on this issue. Just so it can help someone else, I put the flow below.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
30 | |
30 | |
29 | |
21 | |
11 |