FSL Mobile Flows – Adjusted Formulas

This post was originally featured on forcePanda by Narender Singh.

FSL Mobile Flows are still growing in terms of the allowed formulas operators.  As a result, we need to think of other ways to solve scenarios we might otherwise have handled with formulas that are only available on Screen Flows.  The most commonly encountered area in my experience is the lack of IF() logic in FSL Flows.  There are many other examples we could look at, but in this post we’ll tackle this common issue, and a simple approach to solving for it.

Let us use the scenario where’d we like to default a ‘Need By Date’ to an order based on the priority of a Product Request as indicated by a Field Engineer.  The Engineer ordering the part will provide how ‘hot’ the need is and we will set the NeedByDate field based on that priority without further interaction from the Engineer.  In Screen flows, we’d just create an IF() formula variable (or at least I would!) and have it set Date1 IF priority was high and Date2 IF priority was low.  For FSL Mobile Flows we can handle this, but must do so without the use of the IF() statement (for now).

First, we will create two formula variables to set our ‘Hot’ priority vs. our ‘Regular’ priority outcomes.  For High priority let’s assume we need the part tomorrow.

Formula for High Priority

For Low priority let’s assume we the part in two days.

Formula for Regular Priority

Second, we take the user’s input for Shipping Priority. 

Shipping Priority Input

Then we use that user input in a Decision element to determine which formula we will use on the Assignment Element.

Decision Element to Branch Based on Priority

Then we simply assign the appropriate formula based on which branch is taken – below we see the ‘Regular’ branch, or +2 days.

Assigning the chosen Need By Date formula

The flow ends up looking like this.  Note that we’d normally be doing some other updates as part of branching like this as well – not to mention that we could do something like this on insert trigger as well!

Summary of these changes

Please find additional information on mobile flow formulas here.

In the next part, we’ll take a look at managing Parent/Child record creation – Salesforce have provided some exciting updates there recently, so it will actually be less a concern in the future!

Leave a Reply

Your email address will not be published. Required fields are marked *