0

We have the formula below used in the entry conditions of a flow. I a still pretty new to formulas and need some help reading this one. I normally don't use symbols.

!{!$User.Bypass_Automation__c} &&
{!$Record.RecordType.Name} = 'Standard' &&
!isblank({!$Record.AccountId}) &&
isblank({!$Record.Assignee_LS2__c}) &&
{!$Record.Product_Simple__c} != 'CRE' &&
(TEXT({!$Record.StageName}) = 'PQ' || (TEXT({!$Record.StageName})!= 'Closed Lost' && {!$Record.Completed_3rd_Party_Offers_Flow__c}))

Thank you in advance! Jenna

2
  • Could you add more details abuot what, specifically you're confused about? Are you just asking about what the && and || mean?
    – Derek F
    Commented Mar 27, 2023 at 19:34
  • Hi Derek, Yes exactly. The symbols are tripping me up a little bit.
    – Jenna Odom
    Commented Mar 27, 2023 at 19:36

1 Answer 1

1

&& is the infix boolean "and" operator
|| is the infix boolean "or" operator

The infix operators are what most programmers would be familiar with because those operators get used in nearly every programming language out there.

In the end, they do the same thing as the AND() and OR() functions. You can freely convert between them, but the general advice is to choose one approach (functions or operators) and stick with it. Whichever one you choose is mostly down to personal preference.

e.g.

AND(
    condition1,
    condition2,
    condition3,
    condition4
)

is exactly the same as

condition1 && condition2 && condition3 && condition4

Personally, I prefer using the boolean functions because it's less typing (once you get 3 or 4 conditions you're checking) and I find it easier to group and compose functions together.
e.g.

AND(
    condition1,
    condition2,
    OR(
        condition3,
        NOT(condition4)
    )
)

compared to

(
    condition1 && condition2
)
/* This right here is the issue I have with using the infix operators */
/* It's not obvious why this should be && */
/* It's easy to mess up, and hard(er) to identify if it is wrong */
&&
(
    condition3 || !condition4
)

granted, that's a rather contrived example.

4
  • Hi Derek, Thanks so much. And then the "!" before a condition means "Not"?
    – Jenna Odom
    Commented Mar 27, 2023 at 19:54
  • @JennaOdom Yep, you got it.
    – Derek F
    Commented Mar 27, 2023 at 19:56
  • @JennaOdom Just keep in mind that the {!$variable} parts are not applying "not", surrounded by curly braces is used in flows to get access to other data from the flow. If the ! appears outside of the curly braces though (as it does in !{!$User.Bypass_Automation__c}), then that is applying "not" to that particular checkbox field from the user. Thus I conclude my lecture on programming 101 (and writing formulas is very much like programming).
    – Derek F
    Commented Mar 27, 2023 at 20:03
  • Got it!! Thank you again!
    – Jenna Odom
    Commented Mar 27, 2023 at 20:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .