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

image-20240130-115437.png

 

  1. In the Home tab, select Main Flow

    image-20240130-115508.png

     

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

    image-20240130-115633.png

     

  3. Click on Edit Step

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

    image-20240131-082038.png

     

  5. Drag the create command before the finish command

    image-20240131-082102.png

     

  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

    image-20240131-082208.png

     

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

    image-20240131-082337.png

     

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

    image-20240130-120251.png

    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

    image-20240131-082447.png

    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
     

    image-20240131-082617.png


    Click to the field, then select Set Attribute

    image-20240131-082659.png


    The field API name will be populated in the value attribute

    image-20240131-082741.png

  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

    image-20240131-082910.png

    In the field attributes, give value:

    • name: WhatId

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

    image-20240131-082959.png

  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

OwnerID

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

${User.Id}

Required

Required

Subject

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

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

Required

Required

Status

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

Completed

Required

Priority

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

Normal

WhatID

Record ID of the related object. Label is Related To

${Opportunity.Id}
${Account.Id }

WhoID

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

${PrimaryContactRole.Contact.Id}
${Opportunity.Owner.Id}

StartDateTime

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

${today}

ActivityDate

The event due date. Label is Date

${today.plusDays(14)}

EndDateTime

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

      image-20240131-083843.png

    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.