Salesforce Flow – Flow Assignment Data Type Isn’t Compatible

lead-assignmentleadsvisual-workflow

I create a schedule flow to verify if the daily events meets with some requirements, like enddate = TODAY and another value on a field (The first get records and the decision to verify if isn't null)

enter image description here

After this validations, I get the WhoId field on event: (First get records)

enter image description here

And I need to loop through them (the collection variable) because I wanna to assignment the WhoId field to update the status of the leads, but I can't do this, I create a collection of leads and it doesn't show the option to attribute the WhoId field.

enter image description here

And I made a loop through this collection variable, because I need the Ids of the WhoId field (Lead) to update them. But, when I tried to used the assignment property this wasn't possible, I received this message about incompatibility and I don't know how to solve this, I used the get records inside the loop to used the update records after, but I know that DML must not to be used inside loops.
How deal with this?
My goal is basically update the status of the leads (WhoId).

Best Answer

Instead of variable of type Record can you select variable of type String with collection variable so it stores the Ids of the WHOIDS.

To update the lead records you have to use Update record on Lead object where Id in the collection of Strings as below.

enter image description here

You can add the event object and condition in start condition only instead of get record element. It is just a warning as it may cause performance issue