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
Select Upsert if the number of Loop iterations you have set is greater than the number of existing Related List records.
- Upsert is only available as a selection when the Data Set is configured as Map to and From.
- 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.
- 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.
Select Create to make new Related List records.
- This is only available when Data Mapping is set to Map To and From or Map From.
- The Create action will never alter existing Related List records
Select Update to update existing Related List records.
- This is only available when the Data Set is set to Map To and From.
- Update will not create any new records, even if the Loop iterates for more times than there are existing records.