Simple Parent/Child Flow with Decision

Here’s an example of a “simple” flow that uses a Decision element. You don’t need to use flow to achieve the results – you could entirely stick to Process Builder. This flow is for educational purposes only.

Here’s the sitch: I want an automatic email to my customer when we quote a specific product.  For example, “Dear Darnell McCustomer, for a limited time only, you can purchase the EDGE widget for $150!”

Caveat: I want this to be in an HTML template, not a Visualforce email, based on the Quote object. I can’t reach the price on the Quote Line Item from Quote in this format.

Solution: I created a custom field for the price on the Quote, and wrote a flow to populate that field when a Quote Line Item for EDGE is created. The flow is auto-launched from Process Builder.

Scope Change: Oh, wait now there is EDGE Plus Widget, too! We will only sell one at a time, never both. Update the Process Builder to look for either product and update the flow!

overall flow

Let’s look at each step. (I blurred the product name a bit). Look up the EDGE line item and store the price.

lookup edge

Lookup the EDGE Plus Line Item and store it’s price. Note for each lookup I check the box at the bottom to “Assign null values…”

lookup edgeplus

It’s decision time! Which price variable is null, and which is populated? We have two possible outcomes of this decision, “Edge” or “Edge Plus.”

decision 3bDecision 3a

Drag each decision to the appropriate record update box.

edge 4

edge5

Conclusion: You now see how you can use a Decision to update a record.

Food for Thought: The decision, in this case, was completely unnecessary.  The Process Builder could send the price of the Line Item to a variable, say, “LineItemPrice” and we could update the Quote record with that Price. The variable will hold the value of the Line Item, whether it is EDGE or EDGEPlus, because there will only ever be one line item for those two products at a time. Are you following? You may then think, “What is the flow even for? I could just update the quote in Process Builder.” And you’d be correct.

 

 

Published by

JessieRymph

Jessie joined Salesforce.org in 2018 to give introductory webinars to nonprofit customers. She now is a Senior Solution Developer supporting nonprofits and education customers at Salesforce. All opinions expressed on this blog are her own or those of the contributors. She's spent 17 years more or less in CRMs and databases, but didn't meet Salesforce until 2011. Jessie co-led the Seattle Salesforce Nonprofit User Group in 2015-2016. She wrote a sh*tty first draft of a novel and hopes to turn it into a screenplay!

2 thoughts on “Simple Parent/Child Flow with Decision”

Leave a Reply