Explore more
Tools
If-else and Merge
9 min
if else and merge is a new feature currently in open beta share https //f make com/if else merge to help us improve use the if else module with the merge module when you need to split your {{scenario singular lowercase}} into conditional paths, follow only one path based on your logic, and then reconnect the flow into a single route this differs from a docid\ opqxxzcge19tawxhiaehn that runs all routes and can't be reconnected if else module the if else module splits your {{scenario singular lowercase}} into conditional routes only the first condition that evaluates as true runs if no conditions are true , the else route runs structure your conditions from most specific to least specific to ensure that the correct route runs you can add any number of conditions by default, the if else module starts with one condition route and one else route after setting up your routes, you can keep them separate or use a merge module to bring them back together and continue the flow to add an if else module to your scenario, see docid 5f6ozvb5vl2gvdsa7eorp while an if else module and a docid\ opqxxzcge19tawxhiaehn can both split a {{scenario singular lowercase}} into different paths with conditions, the {{scenario singular lowercase}} run process differs true 330,435 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type the if else module uses operations but does not consume any credits merge module the merge module reconnects the conditional routes created by an if else module into a single flow it passes data from the active route to any subsequent modules in your {{scenario singular lowercase}} the merge module only works with an if else module you can't add it to a scenario without first setting up an if else flow to add a merge module to your scenario, see docid 5f6ozvb5vl2gvdsa7eorp the merge module uses operations but does not consume any credits add an if else module the if else module splits the {{scenario singular lowercase}} flow into multiple routes with conditions to add an if else module in your {{scenario singular lowercase}} , click the plus to add another module search for the flow control > if else module the merge module is not available to add to your {{scenario singular lowercase}} until after an if else flow has been set up after adding the if else module, you will see a default setting of two paths, one condition route and an else route set the condition label name the condition condition enter or map the values for the condition add additional rules as needed click save to save this condition to add another condition route, hover over the if else module until you see the white + symbol and click another condition route is added every time you click set the values for each condition and click save optional click the else filter and enter a label click save after you've set all of the conditions, continue to add modules to your {{scenario singular lowercase}} as needed to complete each route you can keep each route separate or add a merge module to bring the routes together and continue the flow restrictions to the if else flow you can't add a router module or another if else module into the flow after an if else module add a merge module the merge module merges the if else routes together and continues the flow with data in a single route the merge module can only be used after an if else module to add a merge module at the end of any route, click the plus to add another module search for the flow control > merge module click and hold the merge module icon to drag and connect it to all routes in the if else flow you can also merge the routes by clicking the plus sign at the end of any route and selecting merge routes enter or map the following values for your merge module output output name if 1st condition is true > output value else > output value add additional if else outputs, if necessary click save the merge module is connected to the if else flow and the {{scenario singular lowercase}} flow can continue after the merge if a condition route does not include a module and you connect the route to the merge module, {{product name}} displays a do nothing module while this route does not include any modules, data passes through to replace the do nothing module with a different module, click the do nothing module and search for your required app delete modules from the if else and merge flow to delete an if else module, right click and select delete this removes the module and all its conditions this action can't be undone any remaining modules after the deleted if else module will show an error until you reconnect them to the {{scenario singular lowercase}} flow if you delete modules before the merge module, the merge module will show an error connect at least one module before configuring its outputs tutorial expense report approval system in this tutorial , you'll build a {{scenario singular lowercase}} that automatically sorts expense report submissions into two paths immediate approval for low value expenses, and a slack notification for expenses that need manual review all submissions are logged in google sheets with their approval status you will need a tally form to submit expense information your form should include the following fields first name , last name , date of expense , description of expense , and amount a slack account, to receive notifications of expenses that need additional review for approval a google sheet file with the following column titles first name , last name , date of expense , description of expense , amount , and approval expense report approval system scenario to build the {{scenario singular lowercase}} step 1 connect to tally click the giant plus and add a tally > watch new responses module click create a webhook enter a webhook name and connect to your tally account in the form id field, select the expense report form you created in tally click save to save the webhook, then save again to save the module settings your {{scenario singular lowercase}} is now connected to tally and triggers when a new form is submitted step 2 set the if route conditions and configure the flow add an if else module and set the first condition, an expense report value that is above the automatic approval limit in this example, expenses of $100 or more are above the limit label above limit condition map the tally field for the amount of the expense and set the condition to great than 100 click save in this first condition route, add a slack > send a message module create a connection to your slack account and select the id of the person to receive the messages your configuration may differ, depending on your slack setup in the text field, enter the message to send regarding the expense report you can map data from the tally form in the message in this example, the first and last name of the person who submitted the expense report is included click save the if condition route identifies expense report submissions that are $100 or more and sends a slack message notifying the recipient step 3 configure the else route flow click t he else route condition and in the label field enter a name click save add a tools > set variable module variable name enter a name for the variable to indicate the status of the approval variable value enter a value for the variable, to show that the expense report is already approved in this route click save the else route is configured to identify expense reports that are under the $100 limit and mark them as approved step 4 merge the conditions and continue the flow after either of the routes, add a flow control > merge module click and hold the merge module icon to drag and connect it to all routes in the if else flow click the merge module and enter or map the following values for your merge output output name approval (to match the field in the google sheets file) if 1st condition is true > output value review required else > output value map the value of the variable set in the else route, status click save add a google sheets > add a row module create your connection to your google account and select the google sheets file you created your values will vary based on where you saved your file, your file name, and the sheet name within the file for each google sheets column, map the tally form data and the merge module output first name first name last name last name date of expense date of expense description of expense description amount amount submitted (in dollars) approval approval click save click save and save your {{scenario singular lowercase}} when ready, docid 8rwfo krohjlepg4qhx3 to run since your {{scenario singular lowercase}} starts with a webhook module, the default setting is to run immediately when data arrives when an expense report is submitted, the information is saved in the google sheets file and marked with the correct approval value google sheets submissions