Use Case - Building a Properties Management Customer Service with Nimbus, Teams, and HubSpot

Build a properties management customer service with Nimbus, Teams, and Hubspot for various use cases.

Consider, we are a property management company. We have the following use cases:

When a NEW customer calls,

  • ... the new contact needs to be created in Hubspot
  • ... any agent can respond to the call
  • ... the agent needs to complete the contact form of the customer 

When a KNOWN customer calls,

  • ... and the customer has a property viewing booked, they wants to speak to the person they will meet at the property.
  • ... and the customer has no active tasks in the CRM, any agency agent can respond.
  • ... the CRM contact page of the customer needs to pop-up when the call gets distributed to the agent.

PRECONDITIONS


💡 For visualization we use Hubspot as example CRM. You can of course substitute this lookup with any other CRM of your own preference. 

 

 Show Icon Legend

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

Build the caller identification power automate flow

Build the flow as described in Use Case - Looking up caller information in HubSpot

Extend the Nimbus configuration

First, we need to create two new Parameters in Nimbus:

  • Parameter 1: Name= PreferredAgent; Value=Empty
  • Parameter 2: Name= hasbookings; Value=false

Then we change the existing workflow to the following:

 Workflow Overview

 
 
Description
Screenshot

The "Check Parameter" activity verifies if the customer has an active property viewing booked in the CRM using the hasBookings parameter that will be set by the power Automate flow.

 

 

The "Transfer" activity will transfer to the preferred agent if the customer has an active property viewing booked in the CRM:

 

Prepare the adaptive cards

The following table summarizes the scenarios and the different Adaptive Cards to send.

Call Scenario Workflow action Adaptive Card

Incoming call

 

new customer

A new customer calls.

  • The new contact needs to be created in Hubspot.
  • An agent needs to complete the contact form of the customer 

Enqueue call

 

We want the contact to be created automatically and send an adaptive card to the teams channel of the service with the following content:

 

 Show Json of this Card

JSON

{
   "type": "AdaptiveCard",
   "body": [
       {
           "type": "TextBlock",
           "size": "Medium",
           "weight": "Bolder",
           "text": "Contact Created"
       },
       {
           "type": "ColumnSet",
           "columns": [
               {
                   "type": "Column",
                   "items": [
                       {
                           "type": "Image",
                           "style": "Person",
                           "url": "https://help.luware.com/download/attachments/31759305/NIMB?version=4&modificationDate=1605004975800&api=v2",
                           "size": "Small"
                       }
                   ],
                   "width": "auto"
               },
               {
                   "type": "Column",
                   "items": [
                       {
                           "type": "TextBlock",
                           "weight": "Bolder",
                           "text": "Nimbus Power Automate Flow",
                           "wrap": true
                       },
                       {
                           "type": "TextBlock",
                           "spacing": "None",
                           "text": "Created @{formatDateTime(utcNow(),'g')} ",
                           "isSubtle": true,
                           "wrap": true
                       }
                   ],
                   "width": "stretch"
               }
           ]
       },
       {
           "type": "TextBlock",
           "text": "New call from unknown customer  @{triggerOutputs()?['body/microsoftCallerId']}",
           "wrap": true
       }
   ],
   "actions": [
       {
           "type": "Action.OpenUrl",
           "title": "Please review contact in Hubspot",
           "url": "@{concat(variables('HubspotBaseContactUrl'), body('Create_Contact')?['vid'])}"
       }
   ],
   "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
   "version": "1.3"
}
 
 

Incoming call

 

known customer

A known customer calls

  • The customer has a property viewing booked
  • They wants to speak to the person they will meet at the property

Transfer to the agent from the booking in Hubspot.

 

We want to inform the team and send an adaptive card to the teams channel of the service with the following content: 

 

 Show Json of this Card

JSON

{
   "type": "AdaptiveCard",
   "body": [
       {
           "type": "TextBlock",
           "size": "Medium",
           "weight": "Bolder",
           "text": "Incoming Call"
       },
       {
           "type": "ColumnSet",
           "columns": [
               {
                   "type": "Column",
                   "items": [
                       {
                           "type": "Image",
                           "style": "Person",
                           "url": "https://help.luware.com/download/attachments/31759305/NIMB?version=4&modificationDate=1605004975800&api=v2",
                           "size": "Small"
                       }
                   ],
                   "width": "auto"
               },
               {
                   "type": "Column",
                   "items": [
                       {
                           "type": "TextBlock",
                           "weight": "Bolder",
                           "text": "Nimbus Power Automate Flow",
                           "wrap": true
                       },
                       {
                           "type": "TextBlock",
                           "spacing": "None",
                           "text": "Created @{formatDateTime(utcNow(), 'g')} ",
                           "isSubtle": true,
                           "wrap": true
                       }
                   ],
                   "width": "stretch"
               }
           ]
       },
       {
           "type": "TextBlock",
           "text": "Incoming call from @{concat(outputs('FirstResult')?[0]['properties']['firstname'], ' ', outputs('FirstResult')?[0]['properties']['lastname'])}, @{triggerOutputs()?['body/microsoftCallerId']}. Outstanding booking. Call will be transferred to agent @{body('Search_Agent_of_the_booking')?['email']}",
           "wrap": true
       }
   ],
   "actions": [
       {
           "type": "Action.OpenUrl",
           "title": "Open contact in Hubspot",
           "url": "@{concat('https://app-eu1.hubspot.com/contacts/26074486/contact/', outputs('FirstResult')?[0]['id'])}"
       }
   ],
   "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
   "version": "1.3"
}
 
 

Incoming call

 

known customer

The customer has no active tasks in the CRM, any agency agent can respond

 

Enqueue call

 

 

 Show Json of this Card

JSON

{
   "type": "AdaptiveCard",
   "body": [
       {
           "type": "TextBlock",
           "size": "Medium",
           "weight": "Bolder",
           "text": "Incoming Call"
       },
       {
           "type": "ColumnSet",
           "columns": [
               {
                   "type": "Column",
                   "items": [
                       {
                           "type": "Image",
                           "style": "Person",
                           "url": "https://help.luware.com/download/attachments/31759305/NIMB?version=4&modificationDate=1605004975800&api=v2",
                           "size": "Small"
                       }
                   ],
                   "width": "auto"
               },
               {
                   "type": "Column",
                   "items": [
                       {
                           "type": "TextBlock",
                           "weight": "Bolder",
                           "text": "Nimbus Power Automate Flow",
                           "wrap": true
                       },
                       {
                           "type": "TextBlock",
                           "spacing": "None",
                           "text": "Created @{formatDateTime(utcNow(), 'g')} ",
                           "isSubtle": true,
                           "wrap": true
                       }
                   ],
                   "width": "stretch"
               }
           ]
       },
       {
           "type": "TextBlock",
           "text": "Incoming call from @{concat(outputs('FirstResult')?[0]['properties']['firstname'], ' ', outputs('FirstResult')?[0]['properties']['lastname'])}, @{triggerOutputs()?['body/microsoftCallerId']}. No bookings found.  Call enqueued.",
           "wrap": true
       }
   ],
   "actions": [
       {
           "type": "Action.OpenUrl",
           "title": "Open contact in Hubspot",
           "url": "@{concat('https://app-eu1.hubspot.com/contacts/26074486/contact/', outputs('FirstResult')?[0]['id'])}"
       }
   ],
   "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
   "version": "1.3"
}
 
 

Extend the Power Automate flow

Now it's time to

Here is an overviw of the whole flow

 
 
Description
Settings
Element

Add two additional "Initialize Variable" element to the flow for the booking parameter and the adaptive card content.

 

 

 

Instead of the UpdateTask add a "Condition" to the flow to check if the Contact Search returned a value.

 

  • lenght(outputs('FirstResult'))
  • is greater than
  • 0

 

At the end of the flow, add a "Post adaptive card in a chat or channel" element to the flow.

 

  • Adaptive Card= variables('AdaptiveCardJSON')

 

IF NO branch - Check if Contact is known in Hupspot

 Overview of the branch

 
 

Add a "HTTPElement" to the flow and rename it to "Create Contact". Fill out the item as shown below.

The body part consists of

  • properties: defines which fields we want to fill. 

Parameters:

Body:

CODE

{
  "properties": [
    {
      "property": "firstname",
      "value": "Please update"
    },
    {
      "property": "lastname",
      "value": "Please update"
    },
    {
      "property": "phone",
      "value": "@{triggerOutputs()?['body/microsoftCallerId']}"
    }
  ]
}

 

Add a "set variable" element to the flow and add the content and set the adaptive card content to the values from step 3. 

IF YES branch - Check if Contact is known in Hubspot

Overview of the branch

 
 

Add a "HTTPElement" to the flow and rename it to "Task Search". Fill out the item as shown below.

The body part consists of

  • filterGroups: defines the search filter
  • properties: defines which fields we want to return

Parameters:

Body:

CODE

{
 "filterGroups": [
   {
     "filters": [
       {
         "propertyName": "associations.contact",
         "operator": "EQ",
         "value": "@{outputs('FirstResult')?[0]['id']}"
       },
       {
         "propertyName": "hs_task_status",
         "operator": "EQ",
         "value": "NOT_STARTED"
       },
       {
         "propertyName": "hs_task_type",
         "operator": "EQ",
         "value": "TODO"
       }
     ]
   }
 ],
 "properties": [
   "hs_task_subject",
   "hs_task_status",
   "hs_task_priority",
   "hs_task_type",
   "hs_task_body",
   "hubspot_owner_id"
 ]
}

 

Store the results of the task sewarch in a "Compose" element

Add a "Condition" to the flow to check if the Task Search returned a value.

Move the existing "UpdateTask" Nimbus element to branch and update the items with the result from the Compose object accordingly.

Parameters

  • RequestId = trigger RequestId
  • Customer.FirstName = outputs('FirstResult')?[0]['properties']['firstname']
  • Customer.LastName = outputs('FirstResult')?[0]['properties']['lastname']
  • Customer.Company = outputs('FirstResult')?[0]['properties']['company']
  • Customer.JobTitleoutputs('FirstResult')?[0]['properties']['jobtitle']
  • Customer.PrimaryTelNumber outputs('FirstResult')?[0]['properties']['phone']
  • Customer.TelNumbers:
    • Office Phone = outputs('FirstResult')?[0]['properties']['phone']
    • Mobile Phone = outputs('FirstResult')?[0]['properties']['mobilephone']
  •  Customer.Customfields:
    • HubSpotId = outputs('FirstResult')?[0]['id']
    • HubSpotUrl = concat(' https://app-eu1.hubspot.com/contacts/<your instance id>/contact/ ', outputs('FirstResult')?[0]['id'])
    • HasBooking = variables('HasBooking')
    • PreferredAgent = body('Search_Agent_of_the_booking')?['email']

IF NO branch - Check if Customer has booking

Add a "set variable" element to the flow and add the content and set the adaptive card content to the values from step 3. 

Click here to expand...

 
 

IF YES branch - Check if Customer has booking

Click here to expand…

 
 

Set the variable hasBookings to true

 

 

Add a "HTTPElement" to the flow and rename it to "Search Agent of the booking". Fill out the item as shown below.

Parameters:

  • Title Search Agent of the booking
  • Method GET
  • URI https://api.hubspot.com/crm/v3/owners/body('Task_Search' )?[ 'results' ][0][ 'properties' ][ 'hubspot_owner_id' ]
  • Headers:
    • Authorization: Bearer @{variables('APIKey')}
    • Content-Type: application/json

 

Add a "set variable" element to the flow and add the content and set the adaptive card content to the values from step 3. 

 

Table of Contents