Field in Record Collection Variable not Updated after Loop Element

administrationlightninglightning-experience

I created a simple record triggered after save flow in Salesforce that should take all related Contacts from an Account and update Email field of these Contacts with specific value.

To iterate over Contact records I used Loop and I also used Assignment element to assign value to Contact Email field.

In the Update Records element I simply use record collection variable to update my Contacts' Email field.

However in debug log, changes to email field done via Assignment element are not made and Email field is not updated, it stays blank. I also saw in debug log that Assignment process worked fine.

Flow:
enter image description here

Debug log:
enter image description here

Assignment element screenshot
enter image description here
Can you please help me in explaining what is the mistake?

Best Answer

There is an issue in the assignment block. As mentioned above by @cropredy You have to add the current element in the loop to a collection variable and update the collection variable as shown below.

Variable for holding a Collection:

enter image description here

assigning the Account email to the current loop

enter image description here

Adding the current element to the collection.

enter image description here

Updating the collection

enter image description here

Related Topic