Branching logic and variables
1. Branching logic and variables
In this video, I'll show you how a flow can remember what came in, and send each kind of inquiry down its own path. This flow answers every customer inquiry the same way, so a pricing question gets the same generic reply as everything else.2. Store the inquiry
First, a variable: a named container that holds a value for the whole run. Select the plus below the trigger, search for Initialize variable, and pick it from the Variable tools. Name it InquiryText, change the type to String, and for the value press slash, choose Insert dynamic content, and pick Inquiry from the trigger.3. Add a condition
A condition is a fork in the road: it tests a value and gets back true or false. Let's add one: select the plus below the variable, and search for Condition.4. Set the rule
In the left box, insert the InquiryText variable. Set the operator to contains, and type pricing on the right. Only messages that contain the word pricing take the True path. A cost question that never says pricing falls through to False.5. Build both branches
On the True side, select the plus, and search for Run a prompt. Run a prompt needs a connection to Microsoft Dataverse, where your prompts are stored. The first time, name the connection, Dataverse, and sign in. Then open the Prompt list, and choose AI Reply. In Input Text, type: Answer this pricing question about our plans, then insert InquiryText.6. False branch
On the False side, do the same: select the plus, and search for Run a prompt. The Dataverse connection already exists now, so just pick it. Then choose AI Reply from the Prompt list. In Input Text, type: Write a helpful general reply to, then insert InquiryText again.7. Save and publish
Select Save draft, then Publish.8. Test both paths
Choose Test, then Manually, and Test. The first time, you're asked to accept the terms: select Continue, and the page reloads. Then choose Test and Manually again, and the Run flow panel opens. Enter a pricing question: what's your pricing for the Pro plan? Select Run flow, and when it finishes, select Done. That takes you to the Activity tab, which shows each step of the run. The run succeeds, and the condition reads True, so the pricing reply ran.9. Test other path
Back in the designer, run the test again, and this time enter: how do I reset my password? This time the condition reads False, so the general reply ran instead. If a message lands on the wrong side, fix the rule, not the branches.10. See both paths
A split canvas gets wide, so use Zoom view to fit, at the bottom left, to see both paths.11. Let's practice!
Now store a value in a variable of your own, and build a flow that branches on a keyword.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.