web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

Convert all files to PDF in Document Set

(0) ShareShare
ReportReport
Posted on by 64
I have a document set in SharePoint, and a SharePoint list with a bunch of files that get attached from a MS form, and I have a flow  that converts all files attached in the SP List to PDF.

Here is the flow I have so far, which is triggered by changing a status on my SharePoint list

 
 
 
 
 
Apply to each loop

 
This works for files in the SP List. But I would like it to be possible to select the document set instead and process all files in the document set the same way I did with files in the SP list.

Any help is greatly appreciated, this is the last step in my entire process and just getting stuck on how to accomplish this. Can provide more detail on each step if needed.

Thank you
I have the same question (0)
  • Suggested answer
    Robu1 Profile Picture
    1,419 Super User 2025 Season 2 on at
    Convert all files to PDF in Document Set
     
    Hi ,
     
    Thank you for choosing Microsoft Community.
     
    It really sounds like you're nearly  there!
     
    To process all files in a document set in SharePoint and convert them to PDF, you could simply modify your existing flow to include a step that retrieves all files within the document set.
     
    Here's a high-level overview of how you can achieve this:
     
    Trigger: Your existing trigger that changes the status on your SharePoint list.
    Get Files in Document Set: Use the "Get files (properties only)" action to retrieve all files within the document set. You'll need to specify the document library and the document set ID.
     
    Apply to Each: Add an "Apply to each" loop to iterate through each file in the document set.
     
    Convert to PDF: Inside the loop, use the "Convert file" action to convert each file to PDF. You might need to use OneDrive for Business for the conversion, as the SharePoint connector doesn't have a direct convert action.
     
    Save PDF: Save the converted PDF back to the document library or another location of your choice.
     
     
    Here's a more detailed step-by-step guide:
     
    Trigger: Use your existing trigger that changes the status on your SharePoint list.
     
    Get Files in Document Set:
    Add the "Get files (properties only)" action.
    Select the document library where your document set is located.
    Use a filter query to get files within the specific document set. For example, DocumentSetId eq 'your-document-set-id'.
     
     
    Apply to Each:
    Add an "Apply to each" action.
    Use the output from the "Get files (properties only)" action as the input for the loop.
     
    Convert to PDF:
    Inside the loop, add the "Get file content" action to get the content of each file.
    Add the "Create file" action to create a temporary file in OneDrive for Business.
    Use the "Convert file" action to convert the temporary file to PDF.
    Add the "Get file content" action to get the content of the converted PDF.
     
    Save PDF:
    Add the "Create file" action to save the converted PDF back to the document library or another location.
     
    This approach should help you process all files in the document set and convert them to PDF. If you need more detailed steps or run into any issues, feel free to ask!
     
    If this Post helped you, please click  "Does this answer your question" and like this post to help others in the community find the answer too!

    Happy to help 

    Robu 1

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 647 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 350 Moderator

#3
developerAJ Profile Picture

developerAJ 256

Last 30 days Overall leaderboard