4

I have a flow that is set to run after the record is saved to the database. The field that triggers the start of the flow is a change on the 'Billing State'.

I want to get an element using the new Billing State value as the condition but the value I'm seeing is the old Billing State Value.

enter image description here

As you can see here, the BillingStateCode was in fact changed. From ND(North Dakota) to NY(New York), BUT when using the BillingState as a condition, it is still using North Dakota.

7
  • I just tested in a sandbox by creating an after-update record-triggered Flow. I confirmed that when I debug by changing the BillingState from "FL" to DE", I see that the $Record.BillingState is still "FL" but the $Record.BillingStateCode is "DE".
    – Moonpie
    Dec 1, 2022 at 1:15
  • And every answer I find on SFSE indicates that that behavior is expected in a BEFORE trigger, but not an AFTER. But I found nothing specific on a Flow rather than Apex.
    – Moonpie
    Dec 1, 2022 at 1:23
  • 2
    Which does not make sense to me because the most recent version of the Order of Execution diagram shows that AFTER TRIGGERS are Step 8 and AFTER SAVE FLOWS are Step 14. So if the triggers see it correctly, it seems to me that the Flows should, too. Unless something wonky and unexpected occurs in Steps 9 through 13....
    – Moonpie
    Dec 1, 2022 at 1:50
  • 1
    fwiw there is a known issue about this behavior in terms of before trigger context with the workaround being to use the Code version of the fields as cropredy noted. Is this behavior only occurring in flow debug mode (or actually affecting real record updates)? Definitely worth a case to confirm if flows have a different limitation here than apex. Dec 1, 2022 at 5:24
  • 1
    Methinks, ErFran, that thou foundst a bug.
    – Moonpie
    Dec 1, 2022 at 13:23

1 Answer 1

0

This help article's last bullet explains why it could still be wrong in debug mode. https://help.salesforce.com/s/articleView?id=sf.flow_considerations_troubleshooting.htm&type=5

When you debug a record-triggered flow, only what’s within the flow is tested. This smaller scope can lead to scenarios where the flow executes as intended while debugging, but not at runtime. This behavior difference can be due to other triggered flows and processes. To see how a record-triggered flow behaves in a real-world scenario, make sure to test it in a sandbox org.

1
  • 2
    Welcome to Salesforce SE! While this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – identigral
    Jan 27, 2023 at 0:12

You must log in to answer this question.

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