In this scenario we demonstrate how to create a callback task in Salesforce for missed calls using the Microsoft Power Automate Connector. The callback task also gets a dynamic due date assigned.

Preconditions - Salesforce Premium Power Automate Connector

At this point we assume you have a Salesforce account with admin privileges. 

To connect to Power Automate to your Salesforce instance, perform the steps below.

  1. Log into your Power Automate account. Within the main menu, go to Data > Connections. Click "New Connection" and select "Salesforce "
  2. When adding the connector, note that this requires a Premium Power Automate account. (lightbulb) Cost of this connector is outside of Luware product scope.
  3. Select your URI, and the API Version and create the connection

(warning)  We highly recommend testing in a "Sandbox" or creating a new account in Salesforce to test the connection. You can delete the account permanently after testing your solution.

(lightbulb) = A hint to signal learnings, improvements or useful information in context.(info) = Info points out essential notes or related page in context.
(warning) = Notifies you about fallacies and tricky parts that help avoid problems.(question) = Asks and answers common questions and troubleshooting points.
(error) = Warns you of actions with irreversible / data-destructive consequence.(tick) = Intructs you to perform a certain (prerequired) action to complete a related step.

How-To Steps

Create the Basic Flow

We start at the trigger for a call that has not been handled:

  1. Start a new "Automated Cloud Flow" with the Nimbus "GetOnUpdatedTasks" Trigger.
  2. Set the Trigger to the Session Event "Queue Left"  to react when a caller leaves the queue.
  3. Add a "Get Future Time" element to the flow and set it to:
    • Interval: 2
    • Time Unit: Days

(lightbulb) This will create a future time from now + 2 Days ahead. Of course you can set this due date to any other interval.

Iterate Contacts and Accounts

  1. Add 2x a "Get records" actions from the Salesforce module in flow. The first one iterates the Contacts table, the second one iterates the Accounts table.
  2. Change the "Get Records" fields accordingly:

    Get records ContactGet records Accounts
    • Salesforce Object Type: Contacts 
    • Edit Name: Get records Contacts
    • Filter Query: (MobilePhone eq '@{triggerOutputs()?['body/microsoftCallerId']}') or (Phone eq '@{triggerOutputs()?['body/microsoftCallerId']}')
    • Top Count: 1

    • Salesforce Object Type: Accounts
    • Edit Name: Get records Accounts
    • Filter Query: (Id eq '@{items('Apply_to_each')?['AccountId']}')
    • Top Count: 1

    (lightbulb) The apply to each component will be added automatically to your flow. 

Create Task

  1. Add a Salesforce "Create record" action to your flow.
    (lightbulb) This will automatically insert a second apply to each.
  2. Create Record fields:
    • Salesforce Object Type: Tasks
    • Relate To Id: AccountID (from the previous step)
    • Due Date Only: Future time

(lightbulb) Of course you can set more values accordingly to your use case.