I store my data in GDrive and the folder structure is something as below.
Root > Month > Region > Site
In each Site folder, I have 7 PDF files but I only want to merge two PDF files that contain “Doc” and “Checklist” in their file names. I use ILovePDF Module for merging the PDF files.
What is the problem & what have you tried?
I have created a template which works (as per the screenshot). However, I want to make sure the order of the mergedfile is as per my requirements. Hence, I need to be able to sort the output array before being processed by ILovePDF.
In the screenshot, I included the debug output and basically what i want to achieve is that Output Bundle 1 Array has two collection. The first one should be the filename 1 - Dok Test 1.pdf. How do I sort these collections before going to the next module?
This is achievable in Make as you already have the order in the Array in just one bundle. It seems that the filename order is already numbered 1 and 2 which is extremely helpful. All you would need to do is add a “Set Variable” or “Set Multiple Variables” module before the ILovePDF module depending on how it needs to go. In that variable find the “sort” function (it is under the “Functions for Working with Arrays” tab, that looks like a table) and then map the Array and then use “filename”
Here’s an example of how you can use this function:
{{ sort(array; [order]; [key]) }} Make Input Markup: Copy-paste the above into the field, including start/end curly brackets for it to import as intended