When creating a Mapping configuration for a Loop Element, you have three options for the Data Action. These are Upsert, Update and Create. The Data Actions that are available in the Mapping tab of a Loop Element depend on the Mapping Set that has been configured for the Smart Form. 


For more information on Data Mapping Sets, please see this article for details: How to use Smart Form Mapping - Create a Mapping Set


Upsert 


Select Upsert if the number of Loop iterations you have set is greater than the number of existing Related List records. 



  1. Upsert is only available as a selection when the Data Set is configured as Map to and From.
  2. If the number of loop iterations is less than or equal to the number of existing Related List records, then Upsert will behave similarly to Update as there will be no additional records to create.
  3. If the number of loop iterations is more than the number of existing Related List records, Upsert will create new records for the surplus.


If you set a Loop Element to iterate 8 times for WorkOrderLineItem, but there are only 5 WorkOrderLineItems in Salesforce, the first five loops will update the existing records and then create new records for the remaining 3.


Create


Select Create to make new Related List records. 



  1. This is only available when Data Mapping is set to Map To and From or Map From.
  2. The Create action will never alter existing Related List records


Update


Select Update to update existing Related List records. 



  1. This is only available when the Data Set is set to Map To and From.
  2. Update will not create any new records, even if the Loop iterates for more times than there are existing records.