Error with PDF Merging Power Automate

Hi,

I am having an error while running one of my flows on Power Automate :

I followed this tutorial (How to merge PDF files in Power Automate (Microsoft Flow), Azure Logic Apps, and PowerApps — Plumsail Documents Documentation) and created the exact same elements (Array variable, then 'Apply to each' action etc.)
On a Test Sharepoint

When I run it, it works correctly

However, when i create the exact same flow but in my real Sharepoint

When i run it, I get this error message :

I saw an other topic having the same problem, but even with deleting the brackets, the error still appears.
I don't understand why does it work correctly with the first flow, but not with the second one ?
I am currently on a Trial version, maybe the use is limited to one flow ?

Thank you,
Alexandre

Hello @amvf,

The trial version has the same functionality as the full one, no limitations.
When you run it on the test SharePoint I see this number in the apply to each section

it means that 3 files were added to the array.

Could you confirm how many iterations were done with the second flow?

I suspect the second array has either 0 or 1 PDF file inside.

Best regards,
Petr
Plumsail team

Hi,

I use the same folder for the two flows, it contains 3 PDF :


I put this folder in the Sharepoint, and it seems that the second flow does 0 iterations

Before this action, I use the block 'Get files (properties only)'

in which i limit the entries to the full path of my Folder (in the two flows), as there is a new folder created for each run.

Thank you,
Alexandre

Hi @amvf,

If the second flow has 0 iterations then the array is empty and the Merge PDF action gives this error.

Make sure to pull all the PDF from the source folder on the previous steps.

Best regards,
Petr
Plumsail team

Hi,

Thank you for your answer. Yes, it seems that the problem is on the "Apply to each" Loop. I made two other flows focused on this step, one on the Test Sharepoint, and the other on the real Sharepoint.

For the Test sharepoint, it runs correctly,

And for the real Sharepoint, there is still this 0 iteration Loop

Is there a parameter (depending on the Sharepoint server) that restrict the use of this loop ? I can't figure out why there is this difference on two identical flows.
Let me know if you have a solution for this.

Thank you,
Alexandre

Hi @amvf,

The Apply to Each section number of iterations depends on the value from the previous SharePoint action Get files (properties only).

So, if the number of iterations is 0, then probably the previous actions returned 0 files from the specified folder.

Check if the previous action Get files (properties) only returns any number of files, check the folder path there as well.

Best regards,
Petr
Plumsail team

Hi,

Thank you for your help ! I finally figured out the problem, which comes from the Get files (properties) action, as you suggested.
Depending on the Sharepoint server, this action must be configured to work correctly :

The real Sharepoint has an important amount of documents, whereas the Test Sharepoint does'nt have that much, so I put the 'Include Nested Items' to "No". Even though I restrict the files to one folder, I must make this configuration.

After that, the flow recognizes the 3 pdf files in my folder, and merge them.

There is an other parameter that could also fix the problem, it's the "Top count", when there is more than 100 files concerned by the action. This parameter can be changed up to 5000.

Thank you for your help

Kind regards,
Alexandre

1 Like