# INSERT

The App Object as an array to be inserted/updated into AirData.

![organizing info](https://3088276961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC6qMwMGWBgxnN70QsDuH%2Fuploads%2Fgit-blob-0aa2b915632b24056bcab4876741b64e16df2267%2Finsert-airdata-request-v182-0.png?alt=media)

\#Insert Properties

\##Objects to insert or update

Expects type `text`.

The Key-Value pairs for the app object. The **Key** refers to the app object property and the **Value** refers to the value to be passed.

### On conflict

Specifies an action that happens when there is a constraint set on the AirData App Object:

**Error**: if the object inserted doesn’t meet the criteria of the constraint and this is set to 'error', when run, it will result in an error.

**Existing**: if the object inserted does not meet the criteria of the constraint and this is set to 'existing', when run, the data operation will run as successful but it won’t insert any rows.

There are three methods to pass data as an object.

#### Method 1:

Use the Visual Query Builder to construct your object. When the object editor icon is selected, click on the "+" icon to add the individual key-value pairs for the app object. The **Key** refers to the app object property and the **Value** refers to the value to be passed.

![](https://3088276961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC6qMwMGWBgxnN70QsDuH%2Fuploads%2Fgit-blob-e78645517755ef2ad6546096dc02b46ad68e7f3f%2Finsert-airdata-request-v182-1.png?alt=media)

\###Method 2:

Create the app object as an input variable in the Data Flow and send the entire app object.

![organizing info](https://3088276961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC6qMwMGWBgxnN70QsDuH%2Fuploads%2Fgit-blob-f6f1a0efc3c87c0f1d06c315b0900138af426320%2Finsert-airdata-request-v182-2.png?alt=media)

#### Method 3:

Construct the app object as a JSON payload, with each individual value with their own input variable.

![organizing info](https://3088276961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC6qMwMGWBgxnN70QsDuH%2Fuploads%2Fgit-blob-147ed522d31098a7e5d1ae03706ef7f6f42ffe17%2Finsert-airdata-request-v182-3.png?alt=media)

## Insert with Related App Objects

The App Object to be updated in AirData with the `__id` of the Related App Object.

#### Method 1:

Updating a record with the `__id` To update an App Object with an app object as a property (Related App Object), construct the object so that the `__id` is the value to be paired with the app object as the key. In the example below `user` is the related app object.

![](https://3088276961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC6qMwMGWBgxnN70QsDuH%2Fuploads%2Fgit-blob-fc5679640b2beb1bd37c32dbdcbc19c8ae0261a4%2Finsert-airdata-request-v182-4.png?alt=media)

\###Method 2:

Updating a record in a single Data Flow

1. INSERT the new data in the App Object that will work as a child (Related App Object)
2. Add a **Transform** Data Operation to get the id of the "child" App Object
3. Pass the id variable of the Related App Object using an INSERT Payload Type in the "parent" App Object.

![](https://3088276961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC6qMwMGWBgxnN70QsDuH%2Fuploads%2Fgit-blob-fa58211f9af746b8c906c005f3502bfaa31b1756%2Finsert-airdata-request-v182-5.png?alt=media)
