The AirData Request Operation provides a mechanism to Read/Write/Update/Delete to and from AirData.
Use Cases
- To save information requested from a Web Flow in the Data Builder.
- Insert a users’ personal information in a CUSTOMER object.
- To update information requested from a Web Flow’s inputs in the Data Builder.
- Update feedback from users in a CSAT object.
- To query data that is currently in an AirData object.
- Requesting a list of countries from AirData.
Data Operation Properties
App Object
Dropdown of App Objects, created in Data Builder, to perform the AirData request on.
Type
Defines the type of action the AirData Request will perform:
- INSERT: to insert a new record to an app object. Allows the ability to control the error if there is a conflict with a constraint set on the AirData App object.
- PUT: updates the app object if the
__id
matches, otherwise will insert a new record. - PATCH: updates an app object if it the
__id
matches, otherwise will return an error. - DELETE: to delete a record from an app object given an
__id
- QUERY: queries data from an app object
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.
Run Results
A Variable is automatically created to hold the results of this Operation. This will be an object describing the result of the operation, as well as the __id
of the objects inserted/modified, depending on the request type.
Examples
QUERY
Data can be queried from AirData either through the visual query builder or through the expression editor
Paginate Type
Limit Offset: Ability to limit the number of rows returned from a query and omit a specified number of rows.
Paginate Limit
- type:
int
- description: Limit the number of pages to return in a query
Paginate Offset
- type:
int
- default: 0
- description: Depth into the result set to return
Query Limit
- type:
int
- default: 100
- description: Maximum number of results to return in a given page
Visual Query Builder
Visual Query Builder provides a visual representation of grouping and querying data in AirData.
The query can either be an AND query or an OR query. AND will query all records if all group conditions are TRUE
. OR will display records if any of the group conditions are TRUE
.
When Adding groups, fields can be combined to create more precise filters. For example, the image below represents a query that will return all records where the score = 10
AND returning_customer = true
OR score > 8
.
Expression Editor
Data can be queried using Airscript. For more information on how to query data in Airdata, see AirData Querying Capabilities.
INSERT
The App Object as an array to be inserted/updated into AirData.
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.
- Method 2: Create the app object as an input variable in the Data Flow and send the entire app object.
- Method 3: Construct the app object as a JSON payload, with each individual value with their own input variable.
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.
Method 2: Updating a record in a single Data Flow
- INSERT the new data in the App Object that will work as a child (Related App Object)
- Add a Transform Data Operation to get the id of the "child" App Object
- Pass the id variable of the Related App Object using an INSERT Payload Type in the "parent" App Object.
DELETE
To designate a column – that is, an App Object instance – to Delete from Airdata, it must be referred to by its unique __id
.
PUT
The value of the App Object to be updated into AirData.
Enter the field to be modified followed by the new value and then refer to the row by its unique __id
. This can be done using the expression editor or using the visual query builder.
Expression Editor
Visual Query Builder