In this use case, we want to cover the following scenario:
- When a call comes in then populate the caller data from the Salesforce contacts.
- When an agent takes the call then log a new call task in Salesforce, open the new Task view automatically so that the agent can easily take notes to it while on the phone with the customer.
Salesforce Premium Power Automate Connector
- Add a connection in Power Automate: Data > Connections > New Connection > choose Salesforce
- Add URL, select API Version and test connection
- 🔍 Either use a sandbox for testing purposes or create a new Account in Salesforce, add some contacts and use that account for your tests. You can delete the account permanently after testing your solution.
Click here to expand...
Preparation in Nimbus
✅ We need to create some variables in Nimbus first.
- In Nimbus, we need to go to Configuration > Parameters and create the following Custom Parameters to store the salesforce task ID and URLs to:
- In Nimbus, ceate a Conversation Context with the URL to a Task in Salesforce: Nimbus > Configuration > Conversation Context
- Make this Conversation Context available in the service: Nimbus > My Services > Settings >(Select Service) > Context
Get contacts then get accounts
✅ We want to search for the caller in the Salesforce contacts and the linked accounts.
- Add a Salesforce Get records element
- Salesforce Object Type - Contacts
- Filter Query (String) - in our example we want to filter on the MobilePhone and Phone column in salesforce. The phone number is stored in Nimbus as “MicrosoftCallerID”
Top Count = 1 we only want to get the first results. We expect this to always return a list with only one item.
- Add another Get records element. This action will immediately add an "Apply to Each element" because the output value of the last element is a collection.
- Filter Query (String) - (Id equals 'AccountID')
- Top Count = 1 we only want to get the first results. We expect this to always return a list with only one item.
Create a task in Salesforce
✅ Assuming that a contact with account has been found in Salesforce.
Add a Salesforce Create record element. This will automatically add a "Apply to each element". Set fields as follows
- SalesForce Object Type = Task
- Name ID = ContactID (items('Apply_to_each')?['Id'])
- Call Type = Inbound
- Task Subtype = Call
Set other additional fields as you want.
Update the Nimbus task
✅ Assuming that your previous data retrieval was successful it's now time to let Nimbus know about it so the caller info is also shown in the UI and the Task URL will be set in Nimbus.
- Add an Nimbus "UpdateTask" action to the end of your flow.
Map the variables (e.g. DisplayName) to the corresponding Nimbus parameters.
- Map the Custom Context Parameters:
Now when it rings in Nimbus the contact information is populated from salesforce. When an agent takes the call, the Task Url is opened in a new Tab and the agent can take notes to the call.
Delete the Nimbus Task if caller has not been handled
Optionally, you if the call has not been handled by an agent, you can delete the task in Salesforce. Here is the simple flow overview: