How to Use a Date Field in the Start Criteria of a Schedule-Triggered Flow

How to Use a Date Field in the Start Criteria of a Schedule-Triggered Flow

Schedule-triggered flow is a type of flow that runs in the background at a specified time and frequency (daily, weekly, or one-time). You can select an object and set specific conditions in the start criteria of a schedule-triggered flow to perform actions on a batch of records. The flow then processes records that meet these criteria in batches of 200. Although multiple conditions can be defined, there is a limitation related to date values. The date filter only accepts manual date entries, not date fields or variables. For example, it's not possible to filter Opportunity records where the Close Date is today. Here is how to use a date field in the start criteria of a schedule-triggered flow.

Date Field in the Start Conditions of Schedule-Triggered Flow

Creating a Formula Field for the Start Criteria of a Schedule-Triggered Flow

You cannot use a date field directly in the start criteria of a schedule-triggered flow. As a workaround, create a formula field on the object and use it in the start criteria. For example, you could create a checkbox formula field that returns true when the Close Date of an Opportunity is today. By referencing this checkbox field in the start criteria, you can run your flow for records that are closing today. Here is a simple formula you can use:

CloseDate=TODAY()
Using a Formula Field in the Start Criteria

Sometimes, a simple checkbox formula may not fully meet your needs. In such cases, you can create a formula field as text or number to support multiple scenarios.

For example, if you want to perform different actions based on the number of days remaining until the Close Date, you can create a formula field that returns the difference between the Close Date and the current date.

CloseDate - TODAY()
Using a Number Formula Field

You can then configure the flow to perform different actions based on the number of days remaining until the Close Date.

Schedule-Triggered Flow with Date Field

As you can see, creating a formula field allows you to easily use a date field in the start criteria of a schedule-triggered flow.

Be the first to comment

Leave a Reply

Your email address will not be published.


*