Sometimes, users look to add if/else cards with branching logic to their FLOs but trip up when they add it. Suddenly, the FLO designer won’t let them save their FLO anymore!
This happens when you are dragging outputs from a card that’s inside an if/else card to somewhere outside of the if/else. This is because the designer knows that if it’s relying on an output from an if/else card and that output might not get generated (because the FLO goes down the other branch of the if/else).
Using the Create Outputs button on the right side of the If/Else card allows you to solve for this problem and create complicated branching logic inside your FLOs. By creating an output, you’re generating a field value that will match the true value that you drag into it or the false value you drag into it depending on which branch of the if/else card that the execution goes through.
Also, using these outputs allows you to create branches in parts of your FLO without needing to maintain two nearly identical branches of cards. Just make the one important part branch inside an if/else and then go back to a regular FLO afterwards.
Let’s go through an example with Google Sheets and Slack.
So imagine I have a FLO that creates new rows in a Google Sheet and then alerts me through Slack once it’s done. That alert includes the Row Number of the newly created row. The image below shows this FLO.
Now, say I wanted to change this FLO so that it’s only creating the rows if the data meets a certain condition. I’d probably try to do something like the FLO shown below. However, you’ll see that the Compose card’s name is in red, which means it’s letting us know there’s an error with the FLO. This is where the If/Else outputs come in.
By creating an output on the right hand side of the if/else card and dragging the output version of Row Number over to the Compose card, you’ll be able to save the FLO!
If you want to get even more complicated with the FLO, you can do similar (or completely different) actions in the other half of the if/else card. Then, the output at the end of the FLO will be either the output from the true branch or the output from the false branch at the end of it.
If you have any questions about If/Else outputs and how they work, just let me know!