Schedule-Triggered Flow to the rescue

I posted a poll on LinkedIn recently and was surprised by the answers. The majority of replies got the answer wrong. We will use a Schedule-Triggered Flow to solve the problem.

The question was “If I created a new number field on an object and added one to this field for existing records, what would the answer be?” The choices were 1, 0, or Null.

The correct answer is null.

Here are the results:

LinkedIn poll image


For any existing records the values have not been set. Even if you set the default value of zero when creating the new field, this will only apply to new records. All the existing records will have a null value in that new field. If you add 1 to these records, null plus 1 still equals null, it does not equal 1 (or zero).


So how do we fix this?

We need to update all the existing records so this new field value is equal to zero, and not null. Then any future addition or subtraction of values for this field will be correct and work as expected.

One way is to use a Data Loader tool, which means we need to export all the records to get the IDs, update the new field value, remove all the records that already have zero, one or another valid value, and then upload this file to update all the existing records.

Here is where a Schedule-Triggered Flow can be a quicker and easier solution.

Proceed as follows:

  1. Create a new Scheduled Triggered Flow.
  2. Set the record criteria (new field = null).
  3. Update the record to set the new field value to zero.
  4. Set the flow schedule to run a few minutes in the future and save and activate the flow.
  5. Check the records have been updated once the scheduled time has passed.

Step-by-step instructions:

Create a new field on the Opportunity object:

new custom filed creation

The List View shows all existing records have a null value for the new field:

list view showing blank (null) values for the new field

Create a new Schedule-Triggered flow:

create a new Schedule-Triggered flow

Set the flow to run 10-15 mins in the future:

set the start criteria

Select the object and records:

set filter conditions


Add an update records element and set Approvals Pending to zero:

update records

Save the flow and activate it. Make sure the current time is before the scheduled run time or you will get an error.

save flow

Also, check that your Company Information (Default Time Zone) is set to your local time zone (or you may wait and wait and never see your flow run).

check local time vs Default Time Zone


Now wait until the scheduled time and when your flow runs successfully, the Approvals Pending values will be set to zero, avoiding future problems.

new list view

This is a great way to handle simple record updates without the need to export, update and import records.

Because the Schedule-Triggered flows are bulkified, you don’t need to worry about exceeding govenor limits for your flow. You will still need to keep in mind that the flow will run once for every record that is to be updated so the 250,000 maximum Schedule-Triggered flow executions per day will need to accommodate this.

Similar Posts