Create subfolders and files either in an existing folder or a newly created folder in Google Drive

I need to check if a folder exists and create one if it doesn’t.
However, in both cases, I need to create subfolders (all in the red outlined part on the right) inside either the existing folder or the newly created one.

Is there a way to avoid repeating the same action after the router results?
A module won’t accept 2 inputs. (Even the router has 1 in, multiple outs)

Any hints?

Yes, You can do this by using Set Variable Module, what you will need to do is after the create folder module on top route set a variable named rootFolderID or something to your liking. And, then continue the upper route if required.

Now, In the route that currently handles conditions for Folder Exists, Remove the existing filter which will ensure that both conditions will go through the route. Put a Get Variable module with variableName specified in the previous route i.e rootFolderID.

Afterwhich, You can get the folderID for bothe cases by using ifempty(rootFolderID;folderIdFromSearchModule).

Sorry about bad formatting on mobile device.


Plus review this document : Converger Help Docs | Integromat Help Center

It has few other approaches to solve this issue.


Very helpful!!
I wish I could mark both of your answers as “solution”