# Create a Task (Salesforce) Data Flow Template

![sal.png](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-2b4d2e4ec562754484b5dddc6dadf1042b9cbe2d%2Fcreate-a-task-salesforce-data-flow-template-v1715-0.png?alt=media)

### Overview

This [Data Flow template](../building-apps/kitcloud/data-flow-templates) is made up of two [Data Operations](../data-operations/data-operation-overview) that allow app builders to create a task in Salesforce. This is achieved by connecting with the Salesforce integration, passing data to this Data Flow and then creating a task with such data.

In [Connection Builder](../studio/builder-bar/connection-builder), Data Flow templates can be found with pre-populated sample data. However, to meet the requirements of their Journey, app builders should perform the necessary adjustments, such as adding other Data Ops.

Bear in mind that in order to use Salesforce as a datasource, credentials must be set in [Configuration Builder](../studio/builder-bar/configuration-builder) > [Integrations](../working-with-data/connecting-to-external-systems/setting-up-integrations) to connect the corresponding account.

### Create a Task (SF) Operations

This Data Flow contains four parts:

#### Inputs

The Start pane keeps track of the inputs required by the Data Flow.&#x20;

* Sample Inputs:
  * task\_datetime [Variable](../working-with-data/variable-scopes) of type [DateTime](../variable-data-types/the-datetime-variable-data-type)
  * user\_id Variable of type [Text](../variable-data-types/the-text-variable-data-type)
  * contact\_id Variable of type Text
  * subject Variable of type Text

#### [Salesforce Data Operation](../data-operations/the-salesforce-data-operation)

* Datasource: Salesforce
* Operation: Create record (Create new record in Salesforce)
* Object Type: Task (Task)
* Object Body:
  * Name ID (Whold)
    * contact\_id
  * Subject (Subject)
    * Subject
  * Assigned To ID (OwnerId)
    * User\_id
  * Status (Status)
    * Waiting on someone else (Waiting on someone else)
  * Due date only (Activity Date)
    * Airkit expression to format DateTime
  * Reminder Date/Time (Reminder Date Time)
    * Airkit expression using the [CONCAT](../airscript-expressions/text-functions/concat) function to add 15’ to DateTime
  * Reminder Set (IsReminderSet)
    * TRUE
* Run Results: sf\_task\_result output Variable of type Any that is automatically created to hold the results of this Operation.

#### [Transform Data Operation](../data-operations/the-transform-data-operation)

* Transform Expression: sf\_task\_results.result.id -  the Airscript expression to retrieve the ID of the task.
* Output Format: Variable
* Type: Text
* Run Results: task\_id output Variable of type Text that is automatically created to hold the results of this Operation.

#### Output

The End step is where variables from the Data Flow can be used as an output..

* Sample Return Value: task\_id of type Text

### Use Cases

* Allow app builders to create a task in Salesforce.
