# Data Flow Templates

### Overview

[Data Flow](../../studio/data-flows) templates provide a simple way to connect data in an application with commonly used actions.&#x20;

Data Flow templates are pre-configured but they need to be further tailored for a customized experience.

Within a Journey, there can be multiple Data Flows, each built with a specific purpose, and they can be triggered from different parts of the application.

### Submitting a CSAT score into Airdata

In this example, a Save CSAT Data Flow has been created to store the application's feedback and score users submit through a Web Flow.

#### Creating a Data Flow from a template

From the [Connections Builder](../../studio/builder-bar/connections-builder), Data Flow templates can be added by clicking on the ‘+’ sign next to Data Flow. This example will use the "**AirData Insert Record**" Data Flow. Data Flow templates are created with some pre-configured information. However, they need to be adjusted to the application’s use case.

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-ed95c08b8631b956f0c6b3fa97985b04f168060e%2Fdata-flow-templates-v180-0.png?alt=media)

It is also good practice to rename Data Flows to easily identify them across the application.

In this example, the Data Flow will save information from the inputs of the "CSAT" Web Flow Template to the an [app object](../../data-and-integrations/airdata/airdata-app-objects) called "CSAT".

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-085dbea04a06636205dac1466b3350c17c86c440%2Fdata-flow-templates-v180-1.png?alt=media)

When a Data Flow is called, the operation steps are executed sequentially starting at the top and working down the Stage.&#x20;

At Start, create an input for this Data Flow with the type CSAT. This is accessible by clicking on the '+' icon and going to **objects** > **CSAT**

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-29bfbd21e54e2f952c9a2fa75303476f1b6be8ce%2Fdata-flow-templates-v180-2.png?alt=media)

Then, in the AirData Request data operation, select the CSAT App object, the Payload Type is INSERT and the object to insert is also CSAT.

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-47aebc5e2991860c3c371b038b9df327094b935c%2Fdata-flow-templates-v180-3.png?alt=media)

#### Connecting Data Flows to Controls

Data Flows are initiated by some other part of the application.&#x20;

Following the example above, in the [Web Flows Builder](../../studio/builder-bar/web-flows-builder) of this app, there is a CSAT Web Flow requesting users to score the app and submit feedback. Once they select a score and leave their comments, they click on a “Submit” button.

In order to store that information in the Save CSAT Data Flow, the following steps should be followed:&#x20;

1. Click the “Submit” button in the CSAT Web Flow![](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-05665030de3673c2e0b44d13914fb9adea5cf255%2Fdata-flow-templates-v180-4.png?alt=media)
2. Click the ‘+’ sign under Actions and select a Data Action![](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-c5a2a0eb063a8dcfe095400f329e9e38abb3e160%2Fdata-flow-templates-v180-5.png?alt=media)
3. Select the previously created Save CSAT Data Flow![](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-4f6f50edbe793efa29d95c6132a77a87139610ee%2Fdata-flow-templates-v180-6.png?alt=media)
4. Add the corresponding inputs to the Data Flow

![organizing info](https://2093598723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2DgLBPTrwoEhWaU24LL%2Fuploads%2Fgit-blob-04d23b7ac91f987694e4f0e1cda711c9fe32107a%2Fdata-flow-templates-v180-7.png?alt=media)

```javascript
{"score": CSAT,"feedback": feedback}
```

As a result, when the customer submits their score and feedback, the values will be saved in the CSAT object through the Save CSAT Data Flow.

### Further Reading

* [Introduction to Data Flows](../../studio/data-flows)
* [Connections Builder](../../studio/builder-bar/connections-builder)
* [Web Flows Builder](../../studio/builder-bar/web-flows-builder)
