Skip to main content

Hi SF Community,

 

I'm trying to use a formula inside Flows. The formula works fine when created as a field on the object, but I am receiving an error when adding the formula inside a Flow.

 

I'm trying to populate a picklist value based off the Lookup ID from a related object.  I have used CASE with TEXT and without, but both are not working.  I receive an error saying "the formula expression is invalid: Field OASP__OAS_Household__r.Lead_Advisor_Lookup__c does not exist. Check spelling."  The field does exist and there is no issue with the spelling.  Here are the two different formulas I have tried. Please see below.

 

Thanks,

Mike 

 

CASE(OASP__OAS_Household__r.Lead_Advisor_Lookup__c,

"0051400000BM7HB", "San Francisco",

"0051O00000CX0b1", "San Francisco",

"0053n000007oOk1", "San Francisco",

"0053n000007o1xR", "San Francisco",

"00530000001g4N8", "San Francisco",

"0051400000BrOEW", "San Francisco",

"00530000006NOyx", "San Francisco",

"00530000001tyUM", "San Francisco",

"0051O00000CWZjr", "San Francisco",

"0053n000007yf68", "Texas",

"0053n000008LuY4", "Texas",

"00530000001tyUP", "Texas",

"005a0000009hD2Q", "New York",

"0053n000007L5Yr", "New York",

"0053n000007avd0", "New York",

"0053n0000081Dk1", "Mountain West",

"0053n0000083rFa", "Florida",

"")

 

CASE(TEXT(OASP__OAS_Household__r.Lead_Advisor_Lookup__c,

"0051400000BM7HB", "San Francisco",

"0051O00000CX0b1", "San Francisco",

"0053n000007oOk1", "San Francisco",

"0053n000007o1xR", "San Francisco",

"00530000001g4N8", "San Francisco",

"0051400000BrOEW", "San Francisco",

"00530000006NOyx", "San Francisco",

"00530000001tyUM", "San Francisco",

"0051O00000CWZjr", "San Francisco",

"0053n000007yf68", "Texas",

"0053n000008LuY4", "Texas",

"00530000001tyUP", "Texas",

"005a0000009hD2Q", "New York",

"0053n000007L5Yr", "New York",

"0053n000007avd0", "New York",

"0053n0000081Dk1", "Mountain West",

"0053n0000083rFa", "Florida",

""))

2 Antworten
  1. Eric Praud (Activ8 Solar Energies) Forum Ambassador
    12. Okt. 2023, 18:50

    Hi,

     

    Formulas in flow use a variable, not simply the field API.

    Make sure you click in the "Insert a Resource" field to get the right field names. If it's a record triggered flow, you shoudl go to $Record> as $Record is the triggering record, so your variable might be something like:

    {!$Record.OASP__OAS_Household__r.Lead_Advisor_Lookup__c}

     

    Also, you don't need the TEXT function in a CASE statement.

    FInally, if going with Idst, you should use the 18 digit Id, you're using the 15 digit Id. It might be better to go with

    {!$Record.OASP__OAS_Household__r.Lead_Advisor_Lookup__r.Name}