Skip to main content
Skip table of contents

Creating Salesforce Task with Flow

In certain steps of the document generation process, you can log activities by creating a task or an event record in Salesforce.

In the template builder, switch to Advanced View



  1. In the Home tab, select Main Flow



  2. As an example, select the Exit step, this step will execute when the Exit button is clicked.



  3. Click on Edit Step

  4. In the Search bar, look for the command create



  5. Drag the create command before the finish command



  6. In the right pane, give the Salesforce Object API in type attribute.
    If you want to create a task, type: Task
    If you want to create an event, type: Event



  7. Drag and drop field tag from SFDC Core Calls to the logic, as a child tag of create



  8. Next, click on the field command. The first field command should always contain the record id.


    In the field tag attributes in the right pane, give value to the name attribute:

    • name: OwnerId

    In the value attribute, select the "..." icon to open Data Source


    Search for a Salesforce field where you have the id of the user, who you want to have the task assigned to. For example, the task will be assigned to end-user who is creating the document at that time, search for User ID field under the User object


    Click to the field, then select Set Attribute


    The field API name will be populated in the value attribute


  9. Relate task or event to other records

    The task or event can be related to another record so that it will appear in the Activities related list of the record. For example, end-user runs Dynamo template to create a document for an Opportunity record. Then the template will create a task for end-users to follow up with that opportunity.

    Similar to step 4, drag and drop a field tag as a child tag of the create


    In the field attributes, give value:

    • name: WhatId

    • value: Salesforce field to refer to record ID of the related record, for example: ${Opportunity.Id}


  10. Add content to the task or event

    You need content to at least fill all the required fields when creating a new task or event. Similar to step 4 and 5, drag and drop more fields tag under the create tag to populate the content. See the table below for field references.

    • The name attribute: the Salesforce API name of a field in the Task or Event object

    • The value attribute: the content to be filled in for the mentioned field. Value can be text, dynamic data from other Salesforce fields, result from calculation or a combination of those

Name attribute

Description /
Label in Salesforce

Example of values

Required in Task

Required in Event


Contains the ID of the user who owns the task/ event. Label is Assigned to





The subject line of the task / event. Label is Subject

Follow-up: ${Opportunity.Name}
Email: ${emailSubject}




The status of the task, such as In Progress or Completed. Label is Status




Indicates the importance or urgency of a task, such as high or low. Label is Priority



Record ID of the related object. Label is Related To

${Account.Id }


Record ID of the related Contact or Lead. Label is Name



The start date and time of the event. Label is Start



The event due date. Label is Date



The end date and time of the event. Label is End

For more field references see:

  1. Example: Log activity after sending document via email

    Whenever end-users send a quotation to an Opportunity, you want to log an activity to the Opportunity record, with information such as:

    • The day the document has been sent

    • Email addresses the document has been sent to

    • The file name of the document

    To achieve this requirement, you can follow the instruction above to:

    • Add create and field tags to the logic on the "Send Option - End" step

    • Add value to the field tag as the example below


    A "Completed" task will be created after the email is sent. End-user will be the task owner. The task is related to the opportunity record in which the document is generated, and referred to the Primary Contact of that opportunity.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.