All Collections
Versions 3.0 and 2.0
Implement
Workspaces
Disabling Upsert for Relational Fields
Disabling Upsert for Relational Fields
Elisa Dinsmore avatar
Written by Elisa Dinsmore
Updated over a week ago

This article is for Flatfile's Workspaces. If you'd like to check out the latest version of the Flatfile Data Exchange Platform, click here!

By default, when using our Relational Data Feature, Flatfile will upsert data from the child sheet into the parent sheet. If you would prefer that the parent sheet not be modified, you can disable this ability with an option placed on the field in the child sheet that should not upsert to its parent.

When building out templates in the Dashboard, this option cannot be added via the GUI field editor; it must be added by modifying the template in the JSON editor.

To disable the upsert ability through the Dashboard, open up the template that needs to be updated and click on the "JSON" tab. Find the field that should be updated and add the following option: "upsert": false. In the editor, it should look like this:

mceclip0.png

Once any linked field that needs this option has been updated, save your template. Make note of the updated templateId of this template and update your Workspace with the new templateId when you're ready to switch it over.

If you are deploying your sheets using the Flatfile Platform SDK, you can add this as an option to your LinkedField field types. The syntax for this would be <<upsert: false>>. For more information about the options available for LinkedFields or for deploying via the Platform SDK, visit our developer docs.

If this option is not included on your sheet, the default behavior will be to upsert data. When this option is added and set to false, any records in the linked field that aren't present on the parent template will not be added to the parent, and instead will display an error in the child sheet to indicate that the field must be matched to a value that is present in the parent sheet.

Did this answer your question?