function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Marco Pollastri 1Marco Pollastri 1 

Get the Oldest Contact and update the contact Role As primary

Hi, I am creating a scheduled flow that is running once a day.

The aim of the flow is to get the oldest contact related to the account and update a contact field called contact role = 'Primary'

The flow is working but is updating all the contacts as primary. Flow StructureGet RecordUpdate
The get record is filtering all the contact related to the account and sorting by created date.
Any idea why all the contacts are updated instead of only the oldest
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Marco,

In the update records section you are selecting all the contacts to update. Instead of that as you are storing the contact id in get records section so update the Last section as below and try.

Update Records:

User-added image
If this solution helps, Please mark it as best answer.