How to combine 2 scenarios?

:bullseye: What is your goal?

connect two branches of one scenario

:thinking: What is the problem & what have you tried?

I tried to visually connect the last two modules, but they didn’t connect. I tried using an iterator.

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

You can’t, that’s not how Make works.

Do they need to be on separate routes though? Cause I don’t see filters. So just have the modules one after the other.

You can use the Make Magic Formula with a set/get variable to go back to one route if needed.

Hey @Romano, bad news, Make just won’t let you do that. You’ll have to handle each route on its own.

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.

Hope this makes sense.

You can probably do something like this:

  • try creating folder with same “month” name
  • if exists, throw error
  • error thrown, search for the folder, and resume with folder ID
  • upload to folder ID

Here’s the trick:

This way, you don’t have to bother with routers and split paths.

Hope this helps! If you are still having trouble, please provide more details.

@samliew

I apologize, but I didn’t understand you.

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?

Using error handling routes.

You can learn more about error handling in these Make Academy units:

Error handling

  • Errors Overview
  • 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 —

Learn Make

How-Tos

Useful to Know

My Custom AppAbsolutely Free!

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!

Hope this helps! If you are still having trouble, please provide more details.

@samliew