Flow

AND(NextStep = “GoWithTheFlow”​, OR(Type <> “WFR”​, Type <> “PB”​))

I never thought I’d say this. But I guess we need a formula builder inside flow decisions.

I recently got involved with an extensive migration-to-flow project.

Many workflow rules and processes needed to be combined into one single flow. 🚧

When you have complicated criteria in a workflow rule, you can use the formula builder in the flow start element to rebuild the same formula. You need to change field references, of course, but the new formula looks more or less the same as the old formula.

The difficulty comes when you combine a few of these workflow rules into one flow. Now you need to write combined formulas.

And if your cases are not mutually exclusive, you need to build at least two-level decision elements to check whether the original email alert or field update has to be invoked.

I understand that this exercise is a challenging task for many. 😓

I have especially seen confusion around negative statements like “does not equal to”. Once you combine these with AND and OR, you end up with very challenging formulas. 🔥

This is a broad topic that I would like to discuss with you in a web meeting event. But before I give you more information on that, let me give you one tip about the AND/OR logic 💡…

When you want to select all Opportunities that are not in Closed-Won or Closed-Lost stage where the NextStep is not blank this is not the formula or criteria you are looking for ❌:

AND(

      NOT(ISBLANK(NextStep)),

       OR(TEXT(StageName)<>”Closed Won”,

        TEXT(StageName)<>”Closed Lost”

         )

     )

This is not correct because the second part of this formula that starts with OR will always yield true.

What you are looking for is this ✅:

AND(

      NOT(ISBLANK(NextStep)),

       NOT(OR(TEXT(StageName)=”Closed Won”,

         TEXT(StageName)=”Closed Lost”

             )

          )

     )

Here the second part of the formula will give you all opportunities that don’t have the values Closed-Won or Closed-Lost in the StageName field.

I have specific recommendations that will make your life easier when tackling a project like this. I am sure you have many tips as well.

This post was originally made to LinkedIn on October 2, 2022.

Read the previous post: Winter 23 Flow Usability Improvements Will Make Your Life Easier

Standard

One thought on “AND(NextStep = “GoWithTheFlow”​, OR(Type <> “WFR”​, Type <> “PB”​))

  1. Pingback: Blog - Salesforce Break

Leave a Reply