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 / "Merge PDF Files" Acto...
Power Automate
Answered

"Merge PDF Files" Acton - Error Object reference not set to an instance of an object.

(0) ShareShare
ReportReport
Posted on by 357

Hi Team,

I am getting this while merging 3 files.
why I am gettig this error while merging?
I have read other forum about same but not get the proper solution.

Thnaks in advance.
"Merge PDF Files" Acton - Error Object reference not set to an instance of an object.

I have the same question (0)
  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @Sanket1 ,

     

    I think the Problem is with the file path.Make sure that the file paths provided in the “Merge PDF Files” action are correct and the files exist at those locations.

    If Possible share the screenshot of the flow.

     

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


    Thanks & Regards

    Vishnu Reddy

  • Sanket1 Profile Picture
    357 on at

    Sanket1_0-1719307492208.pngSanket1_1-1719307628704.png

     

  • Sanket1 Profile Picture
    357 on at

    Now I am printing the values does it empty before passing to merge pdf action but 
    My variable contain values of file path still it throwing error

  • eetuRobo Profile Picture
    4,579 Super User 2026 Season 1 on at

    Try without quotation marks/apostrophes around the variables and square brackets around the variables in Merge pdf files -action

    eetuRobo_0-1719308376151.png


    Like so:

    eetuRobo_1-1719308422845.pngeetuRobo_2-1719308453891.png

     

  • Sanket1 Profile Picture
    357 on at

    Its throwing error for var_Part_AFile variable
    When I tried after skipping the above variable its work.
    This variable also return the correct file path by CurrentItem variable ( Current_PartA_File).
    Why its throwing error.

  • eetuRobo Profile Picture
    4,579 Super User 2026 Season 1 on at

    Can you show the error and what value the var_Part_AFile -variable has in it when the error happens(you can draw over the actual filepath text but just to see that its a correct filepath)?

  • Sanket1 Profile Picture
    357 on at

    Correlation Id: 9b3f25de-b346-493a-b2e6-00831b23bf82

    Object reference not set to an instance of an object.: Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Failed to merge PDF files: 'C:\Users\sanket.shinde\Downloads\Er\PAN_Annexure\GJRBC4059Z_Annexure_2024-25.pdf', 'C:\Users\sanket.shinde\Downloads\Er\PAN_Part_B\GJRBC4059Z_PartB_2024-25.pdf', 'C:\Users\sanket.shinde\Downloads\Er\PAN_Part_A\GJRBC4059Z_PartA_2024-25.pdf' ---> System.NullReferenceException: Object reference not set to an instance of an object.
    at Microsoft.Flow.RPA.Desktop.Modules.PDF.Actions.PDFium.PDFium.FPDF_SaveAsCopy(IntPtr doc, FPDF_FILEWRITE writer, Int32 flags)
    at Microsoft.Flow.RPA.Desktop.Modules.PDF.Actions.MergePDFFilesAction.Execute(ActionContext context)
    --- End of inner exception stack trace ---
    at Microsoft.Flow.RPA.Desktop.Modules.PDF.Actions.MergePDFFilesAction.Execute(ActionContext context)
    at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)



    Sanket1_0-1719313927502.png

     

  • eetuRobo Profile Picture
    4,579 Super User 2026 Season 1 on at

    I meant the variable value that you said was giving error. Like so:

    eetuRobo_0-1719315067346.png

     

    Does your Merge PDF files -actions PDF files field look something like this(with different variable names):

    eetuRobo_2-1719315147638.png

    So just precent signs and square brackets around all the variables and variables only separated by commas (not quotation marks).

     

  • Sanket1 Profile Picture
    357 on at

    I have tried this expression ,
    it throws error for me, pdf files must be list of files

  • Verified answer
    eetuRobo Profile Picture
    4,579 Super User 2026 Season 1 on at

    Then your variables probably have wrong values. 
    Can you share screenshots of your variables and their values. Especially the var_AnnexureFile -variable.
    Like this:

    eetuRobo_2-1719318113721.png

     


    Are they actually filepaths? It should work like this:
    eetuRobo_0-1719317952341.png

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard