Stoyan, thanks for your response. Earlier, the PDF.co module extracts data from invoices. The invoices are from 2 companies. I need to automatically create nested folders by year and month. I’ve already created the year and month variables. So the OneDrive module checks if a folder with that year or month exists — if not, one branch creates a folder for the year or nested folder for the month, and if the folder exists, it saves the PDF there. With only 12 months in a year, this creates a lot of duplicate branches. How can I set it up to check if the folder exists, create it if it doesn’t, and save the file there if it does?
You can use the Magic formula for that. Have the module check if the folder exists then have a router with 3 routes.
First route has a filter that checks if the folder doesn’t exist, creates a new folder and sets the folder id inside a variable.
Second route has a filter that checks if the folder exists and sets the same name variable as the top route with the folder id.
Third route has no filter so it always executes and starts with a get variable that gets the folder id which was set by either the first or second routes.
How did you manage to split the scenario branch without a router in the screenshot? Maybe it was just an example, but I’m confused.
Here’s how I’m seeing it now: the OneDrive module checks if the folder exists — if yes, upload the PDF there and the branch continues for multiple other processing steps; if no, use a router to create the folder and that branch ends. Then I’d have to resubmit the PDF file for it to actually save, which means multiple data processing cycles. That’s probably the simplest way to avoid creating infinite big branches. Or is there a better approach?
Error handling directives - Ignore, Rollback, and Commit
Retrying automatically - the Break directive
Error handling using routers and filters
I’d really recommend going through the full Make Academy if you haven’t yet!
Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —
Save development time and operation credits with these utility modules: Chunk Text; Chunk Array; Chunk Words; Multiple Find & Replace; Collection to Array/String List; Execute JavaScript; Estimate Tokens; Calculate Difference Between Two Dates; Get Next Business Day (with holidays); List Upcoming Dates of Day of Week; and more!