Salesforce Fact #9 | Flow tweak
Suppose
we have a use case: we have to update the description of certain
account records daily and we are using auto-launched flow for this.
Now,
we have get records and update records element in auto launched flow
which we can use for this scenario. So we may think like we will first
fetch the records using a get records element and then we will iterate
through each of the account record and populate the description field.
And in the end, we will update the data using the same set of record
which has been returned from get records element.
But here is the
tweak, if we have a use case where we are fetching the data in the
flow, doing some modification and then have to update the same records,
we cannot rely on the get records result set. We have to create one more
collection variable and add each record in it once the description is
updated. Also we have to use two separate assignment element one for
updating the description of the current iterated record and the second
one for adding the record to the new collection.
And finally we will update the records using the new collection variable.
Attached is the flow image.

Comments
Post a Comment