Greetings.
I am trying to configure a flow for a Sharepoint library that would convert a selected file to a PDF and save it in the same library. Here's what I have:
However, when I run it, it gets stuck on Step 2 ("Get file content using path"). When I go to edit that step, I think I should be using dynamic content, but the options seem rather slim.
I would appreciate assistance/guidance from anyone with more experience configuring flows.
Thanks.
This is excellent Marvin - thank you.
You need to use the "Get file properties" SharePoint action, this will give you the dynamic value of "file name with extension".
If you have more questions, feel free to open a new thread within this community. You can also add a link reference to this thread and @mention me. But because this thread has already been accepted as a solution for a long time and if you need any further help and I am not available, it will not be seen within the community, and you won't get help fast.
Best regards
Marvin
If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.
Blog: Cloudkumpel
This is very helpful - I am trying to create a similar flow to this and would appreciate your feedback.
I am trying to set up a recurring flow that runs each night of the week, and so I have a recurrence trigger.
My intention is to convert an excel file to PDF from a SharePoint site, then email it out to a distribution group.
I am trying to follow your dynamic inputs above, but since my trigger is a recurrence and not "For a selected file" as noted in a reply below, I do not have the dynamic content of "File Name with Extension" to set up the rest of the flow correctly.
Any advice? Here is a screenshot.
Hi,
Quick question reference this flow - I have a similar flow and I'm trying to keep it away from One Drive for Business as this is more associated with a users account rather than a team's SharePoint site.
My flow is similar:
Get File Content (Sharepoint)
Create File (OneDrive)
Convert File Using Path (OneDrive)
Send an Email V2
If I was to change to:
Get File Content (Sharepoint)
Create File (SharePoint)
Convert File Using Path (OneDrive)
Send an Email V2
Will that work?
I wasn't sure if I can still use the Convert File because I'm not creating the file in OneDrive.
This is great info! Any idea how to then delete the file from OneDrive Business? It keeps failing for me.
EDIT: I figured this out. I had to put it above the last flow segment to create the new file in Sharepoint.
THANK YOU so very much for your help. I made a few tweaks to where pdfs are stored, but the flow works!
Hey @gregtate7748
try the following:
Action: OneDrive - Create File:
Folder Path = /
File Name = @{outputs('Get_file_properties')?['body/{FilenameWithExtension}']}
File Content = @{outputs('Get_file_content')?['body']}
Action: OneDrive - Convert file using path
File Path = @outputs('Create_file')?['body/Path']
Target type = PDF
Action: SharePoint - Create file
Site Address = <Your SharePoint Site>
Folder Path = Your target SharePoint folder
File Name = @{outputs('Get_file_properties')?['body/{Name}']}.pdf (I used the same name as from the initial file)
File Content = @{outputs('Convert_file_using_path')?['body']}
First we need to create a file in OneDrive so the convert finds the document, we just use the "File name with extension" and "File content" from SharePoint to create this file. Then we convert this file using a path. After converting it, you need to create the final PDF in your SharePoint site (or in your personal OneDrive etc.) using the converted file content.
You maybe should also consider adding an action "OneDrive - Delete file" to delete the temporary file created in OneDrive.
Best regards
Marvin
If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.
Thanks for the suggestions. I've made a couple of adjustments and got it to mostly run. However, it is failing on the final step, Convert File. So far none of my input choices have worked. Any suggestions?
Hey Mate,
If you want more option(dynamic content use the approch) - Please find screenshot below -
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.
Hey @gregtate7748
can you try using the action "get file properties" with the ID from your trigger and then the action "get file content" using the dynamic value "Identifier" from your "get file properties" action? This should fix the issue on your second action. Using the ID is not the identifier it is looking for with the "File path", it looks for more like "/Shared Documents/FolderName/Documentname.docx". Using the "Get file properties" should give you the right identifier.
Hope this helps you!
Best regards
Marvin
If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional