Search code examples
salesforcesalesforce-lightning

Lightning Flow Builder - compare a date field to $Flow.CurrentDate


I'm looking for a way to set a condition requirement that a specific date field will be equal to today's date, or yesterday's. How do I do it?


Solution

  • Add a new formula resource of type Date and name it yesterday (or whatever) and put that code in there.

    {!$Flow.CurrentDate} - 1

    Edit: I am not sure if you are doing something differently but here is a screenshot of a Get Records flow element filtering based on a formula value:

    get records, filter on formula value

    And to be perfectly clear, here is a screenshot of that formula definition:

    date formula definition: yesterday