Create or Update with the new ‘Upsert Records’ Action

Use UpsertRecords when you want to take a collection that may or may not already exist in the database and save it. If the records in the collection have valid Id values, the corresponding records in the database will be updated with the flow’s collection. If not, new records will be created and saved.

UpsertRecords provides functionality similar to the Apex ‘upsert‘ command. You can optionally provide the name of a field on your object that is the externalId (currently disabled until Summer ’20), and you can specify that you want partial saving to work even if some of the saves fail (‘all or none’).

This functionality is available in the CollectionActions package starting with version 1.19.2

You can provide either a collection or an individual record (and in fact can provide both), but because of a limitation in the action configuration framework, you have to specify both types, even if you’re only using one, like this:

Inputs and Outputs

AttributeType
inputCollectionList<SObject>
inputRecordSObject
externalIdFieldNameString (note: this is temporarily disabled but will be added in Summer ’20)
allOrNoneBoolean

This action currently has an output called ‘placeholder’ that should just be ignored. If an error occurs during the upsert, the error message will be thrown back to the flow

Installation

Install the Collection Actions package, starting with 1.19.2

Subscribe
Notify of
guest
3 Comments
Inline Feedbacks
View all comments
Jake Bullard

The beautiful flow stuff just keeps coming! This is a huge time saver!

Peter Bender

Is there a way to know which records were created vs updated? A nice enhancement would be to return the two in separate collections. Otherwise if I want to do something with the IDs of the newly created ones, I can’t know which they are.

[…] 7/20: UpsertNew! 6/20: Report […]