Add Block
The Add block adds child data into a parent record for zero to many relationships in datastores that support hierarchical data. For example, if the source parent record Account, contains one or more Contact child records, you can use the Add block to add Contact records to that Account record. When the Account record is complete, including its associated child records, it is written to the target datastore along with all of the child data, in a single operation. See Hierarchical Data.
Notes
When working with Add blocks, note the following:
- Add blocks can only be used within a CreateWith Block, UpdateWith Block, orUpsertWith Block . You can use an Add block inside a For Each Child block as long as the For Each Child is inside a CreateWith, UpdateWith, or UpsertWith.
- If the Add block is added to the flow directly inside a CreateWith, UpdateWith, or UpsertWith block only related entities with one to one relationship with the parent entity can be accessed. In the image above, contact is the parent entity and has a one to one relationship with mailing address and a one to one relationship with billing address.
- If the Add block is added inside a For Each Child block, only related entities with a zero to many relationship with the parent entity can be accessed. In the image above, contact is the parent entity and has a zero to many relationship with accountusa and with accountemea.
- An Add block must reference the same parent as the block that contains it and any Add blocks above it inside the same block. For example, if the CreateWith Block parent entity is contact, the first Add block might add a mailingaddress, the second Add block might add a billingaddress, but both have the same parent entity as the CreateWith block.
- Add blocks must reference entities in hierarchical order. For example, if the hierarchy is Country, State, City and the CreateWith Block parent entity is Country, the first Add block cannot be City, it must be State.
As part of configuring an Add block, you:
- Select the child entity to use for this Add operation.
- Map the fields you want to add to the new records.
Block Properties — General Tab
From the Block Properties General Tab, you can change the Block Label, add a description, and select the child entity to use for this operation.
Use the Path field to select the child entity to be added. This field also shows you the relationships. In the image below you can see that country is the parent of state and state is the parent of city.
Block Properties — Fields Tab
From the Block Properties Fields Tab, you can:
- Create links between source and target data fields, including fields from the relationships that you specified in the Query Block or Fetch Block:
- Source fields from parent entities are available in all blocks.
- Source fields from child entities are only available within a For Each Child Block for that child relationship.
- Use the SmartMapper service to help you link selected source and target fields. You may need to clear some fields linked by SmartMapper, such as any modifiedon or createdon datetime fields. See SmartMapper.
- Create simple or complex formulas to transform source data. See Formula Editor Overview.
- View detailed information about any field in your source or target using the Info icon .
When using the Fields tab, you can:
- Use column filters to find specific data in the source or target pane as described in Using The UI Filters.
- Select any column head to sort all fields in the pane by that column.
For detailed information about using the Fields tab, see Block Properties Fields Tab.
Block Properties — Error Handling Tab
Use the Error Handling options to enable or disable processing this record when a block operation encounters a problem. For the Add block, errors can be logged when an operation fails. See Block Properties Error Handling Tab for additional information.
If this setting is checked, an error from any part of the data, parent or child, generates a record error and no more blocks execute for that record. If the setting is unchecked, no error is written to the log and the flow continues running with the text of the error available in the Result Fields.
Block Properties — Errors And Warnings Tab
If there are any errors or warnings for this block, the Errors and Warnings tab displays the number of errors or warnings in the tab name. See Block And Flow Errors And Warnings.
Once you have corrected the errors, select the Validate button to update the Errors and Warnings tab.