Create Power Automate Flow to copy PDF files from the OneDrive folder to the corresponding Document Set in the SharePoint library matching File Name and a Column of DOC SET.

Anonymous
2025-07-13T07:50:40+00:00

Support is required to Automatically copy PDF files from the OneDrive folder to the corresponding Document Set in the SharePoint library, where the filename (without extension) matches the One property of the Document Set. Note, I have multiple Document Sets already created in SPO and there are many PDFs in my OneDrive folder. Match is only "PDF Name" and One Column of Document Set (having in file name".

Source: OneDrive folder containing multiple PDF files.

Target: SharePoint library with multiple pre-created Document Sets along with filled metadata (properties).

Goal: For each PDF file in the OneDrive folder, the flow will:

  1. Extract the filename of the PDF.
  2. Compare it against a designated property (column) of each Document Set.
  3. If a match is found, copy the file into the corresponding Document Set folder using the original filename.

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2025-07-13T12:20:26+00:00

    Thank you for contacting Microsoft Community.

    To create a Power Automate flow that automatically copies PDF files from a OneDrive folder to the corresponding Document Set in a SharePoint library based on filename and metadata column match, I try to test, and you can try my below step by step solution:

    1. Trigger Setup
      • Use the trigger “When a file is created” in OneDrive for Business.
      • Apply a filter to ensure only .pdf files are processed.
    2. Extract Filename
      • Use the “Get file metadata” action to retrieve the filename.
      • Apply an expression to remove the .pdf extension: split(triggerOutputs()?['headers']['x-ms-file-name'],'.')[0]
    3. Retrieve Document Sets
      • Use the “Get files (properties only)” action from SharePoint to retrieve all Document Sets and their metadata.
      • Use “Filter array” to find the Document Set where the designated column matches the extracted filename.
    4. Copy File
      • Use the “Create file” action in SharePoint to copy the PDF into the matched Document Set folder.
      • Use dynamic content to retain the original filename.
    5. Error Handling
      • Add a “Condition” to check if a match was found.
      • If no match is found, log the filename or send a notification.

    Note and some reference I have found may be helpful for you:

    • Power Automate supports workflows across OneDrive and SharePoint, including copying files between them and automating tasks based on metadata conditions. You can start by selecting a flow template or creating a custom flow from scratch using the Power Automate designer interface Microsoft Support Reference
    • For more information on copying files between OneDrive and SharePoint, please refer to this guide: Copy files and folders between OneDrive and SharePoint

    Please understand that as a community moderator, because of our limit of scope and our response does not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution.
    I really hope my information helpful for you! Feel free to ask me if you have any trouble!
    Best Regards,

    Vicky-I - MSFT | Microsoft Community Support Specialist

    0 comments No comments
  2. Anonymous
    2025-07-16T14:32:05+00:00

    Hello Asif Rehan,

    It has been a while and I am writing to see how things are going with this issue. Have you had a chance to check the replies provided? Any update would be appreciated.

    If the answer is helpful, please mark it as an answer, which will definitely help others in the community who have similar queries to find solutions to their problems faster. Thank you for your understanding.  

    Best Regards, 

    Vicky-I - MSFT | Microsoft Community Support Specialist 


    ⚠️ This forum has moved!

    Microsoft Support Community is now supported on Microsoft Q&A

    Starting July 16, new questions must be posted there.

    Existing discussions on Microsoft Answers will remain accessible through July 21, after which customers will be redirected to Q&A.

    0 comments No comments