[SalesForce] Update Records on a Collection variable only updating one record

I've got a simple flow that gets a collection of records, loops through it to assign a new value to a single field, then add the record to a new collection. After the loop finishes, I put the new collection into an Update Records element set with "Use the IDs and all field values from a record or record collection".

This is how I thought we're supposed to do it to avoid putting updates into a loop. As you can see in the debug image, there are two records in the collection, but when the flow finishes only one record in the collection is actually updated.

Can someone point me to what I'm doing wrong or misunderstanding here?

enter image description here

Best Answer

You're updating the values in {!Policies}, which should really be named something like "Current_Policy", as it's just an sObject, not a Collection. The list you were adding to was {!col_New_Policy_Collection}, which should be the target of your Update Records element. By the way, it is not necessary to copy the records from one collection to another. You can simply set the new field value and to the Collection assigned to in Get Records, and update that Collection directly.

Get Records ➡   Loop   (After Last)  ➡  Update Records
                  ⬇⬆ (For Each)
                Assign Value