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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PAD Merge PDF Giving E...
Power Automate
Unanswered

PAD Merge PDF Giving Errors

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

 

I am currently having some issues with desktop flow triggered from cloud flow.

 

Cloud Flow: OneDrive - When a file is created -> Trigger Desktop Flow

 

Desktop Flow: Get files in folder (that match with "*" and store them into "Files") -> Move Files (store them into list "Moved Files") -> Merge PDF Files (Merge "Moved Files" into folder and store them into list "Merged PDFs") -> Delete "Moved Files"

 

I run into an error with the Merge PDF Files action where it either throws a "Value cannot be null" error when the "Moved Files" variable does not include quotes or a "Access to folder is denied" error when the "Moved Files" variable includes quotes. The flow had worked at one point. Then, I'm not so sure what exactly happened, the folder I had created for this flow in our organization's OneDrive and shared with the person who needed access to this flow no longer showed in my file explorer and no longer was able to be contacted by the desktop flow. I had created a new flow and new folder with new subfolders the same exact way I had done so before, yet I am still unable to engage the PDF merge.

 

Any and all help would be greatly appreciated.

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @BranJens41 

     

    If possible could you please share some screenshot of your flow?

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀. If you'd like to appreciate me, please write a LinkedIn recommendation 🙏

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @BranJens41 ,

     

    Is this what your trying to build .

    As per my understanding i have built a flow.

    1.Your BOT will trigger when some files are created in onedrive.

    2.You want to move all those files into a Particular Folder called "Moved Files"

    3.Once the files are moved, you will get also those files from "Moved Files" Folder and merge it into a Single PDF.

    4. And Merged PDF you want to store it into a Separate Folder Called "Merged PDFs".

    5.Once it is done you want to delete all the Files from "Moved Files" Folder.

     

    Please find the below solution.

    VishnuReddy1997_0-1711082226483.png

    Code:

     

    Folder.GetFiles Folder: $'''C:\\Users\\OneDrive\\Desktop\\Power Automate Desktop\\Practice\\Merge PDFs''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    File.Move Files: Files Destination: $'''C:\\Users\\OneDrive\\Desktop\\Power Automate Desktop\\Practice\\Merge PDFs\\MovedFiles''' IfFileExists: File.IfExists.DoNothing MovedFiles=> MovedFiles
    Folder.GetFiles Folder: $'''C:\\Users\\OneDrive\\Desktop\\Power Automate Desktop\\Practice\\Merge PDFs\\MovedFiles''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    Pdf.MergeFiles PDFFiles: MovedFiles MergedPDFPath: $'''C:\\Users\\OneDrive\Desktop\\Power Automate Desktop\\Practice\\Merge PDFs\\MergedFiles\\MergedPDF.pdf''' IfFileExists: Pdf.IfFileExists.AddSequentialSuffix PasswordDelimiter: $''',''' MergedPDF=> MergedPDF
    File.Delete Files: Files

     

    I have framed those logic with my assumption so pls fine tune it as required.

     

    (Note:- if you got your solution you can mark as solution and gives kudos)

     

    Thanks & Regards

    Vishnu Reddy

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    If you have a Premium license, I would recommend using the OneDrive actions instead of relying on the OneDrive app to sync those files for you. This would work much better. Try using List files in folder, then iterate through them and use Get file content on each of them, and then Convert binary data to file to create a copy of the file locally. You can then merge these files as you need them. If needed, you can also use Delete file under the OneDrive actions to delete the original files, too.

     

    While this will require slightly more actions, as you need a loop and cannot really get all files in one go, it will be much more stable and reliable.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 378

#2
Valantis Profile Picture

Valantis 329

#3
David_MA Profile Picture

David_MA 283 Super User 2026 Season 1

Last 30 days Overall leaderboard