Use Case - Sending SMS message Via Adaptive Card during a Nimbus call

Send an adaptive card to the agent who can then send an SMS message to the caller

This Use Case demonstrates the capability of sending SMS to customers via an Adaptive Card presented to the Agent. To achieve this, the Nimbus Nimbus Power Automate Connector waits for the “Agent answers a Nimbus call” trigger, which then creates an Adaptive Card Agent for the Agent to send an outbound SMS message to the Caller. 

Important: This Use Case is only for OUTBOUND Instant Messaging only. It does not provide any functionality for inbound messaging and serves only to allow the  Agent to send information outbound to the Caller!

 

PRECONDITIONS

  • Nimbus Power Automate Connector preconditions must be met (Nimbus Service, User Roles, Microsoft Power Automate Premium License).
  • This Use Case example uses Twilio as the messaging service, however other services such Microsoft Azure communication Services can be used. 
 

Create Power Automate Flow 

  1. Start with the When a task changes state trigger of the Nimbus Connector.
Field Fill in / Use Dynamic Content 
Service item Select the UPN of the Service
Task Events Select Connected to User
Description Screenshot

Add an Initialize variable element to the flow and set

  • Name = Caller Number
  • Type = String
  • Value = @triggerOutputs()?['body/CallerTelNumber'] or use Dynamic content to select CallerNumber

Add another Initialize Variable, set 

  • Name = Message
  • Type = String
  • Value = leave blank ( we will fill this in later) 

For Initialize Variable 1, under settings:

  • Select Run after 
  • Set Initialize Variable is Successful  

 

Add the Adaptive Card

Description  Screenshot
Add a Post adaptive card and wait for a response action

Set the following

  • Post as = Flow bot
  • Post in = Chat with Flow bot
  • Recipient = UPN of last connected user
  • Update message = Message Sent!
  • IsAlert = Yes

For the message you will need a Adaptive Card template. You can a service such as:

… to help you design your Adaptive Card and paste the code into the message section. 

 

💡We have also prepared an example card code below.

 

 

 

 

 

An example:

Code example: Adaptive Card - To send message 

Description Screenshot

To = Automatically populates the Callers number, can be overwritten to a different number if required by  Agent 

 

Message = free text for  Agent to enter the message they wish to send to the Caller. 

 

 

{
 "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
 "type": "AdaptiveCard",
 "version": "1.4",
 "body": [
 {
 "type": "ColumnSet",
 "columns": [
 {
 "type": "Column",
 "items": [
 {
 "type": "Image",
 "style": "Person",
 "url": "https://luware.com/hs-fs/hubfs/Theme%20Luware/svgviewer-png-output.png",
 "size": "Small"
 }
 ],
 "width": "auto"
 },
 {
 "type": "Column",
 "items": [
 {
 "type": "TextBlock",
 "weight": "Bolder",
 "text": "Luware Nimbus via Power Automate",
 "wrap": true
 },
 {
 "type": "TextBlock",
 "spacing": "None",
 "text": "Lunifico Demo Service",
 "isSubtle": true,
 "maxLines": 1,
 "wrap": true
 }
 ],
 "width": "stretch"
 }
 ]
 },
 {
 "type": "TextBlock",
 "text": "Send a message using sms",
 "wrap": true,
 "weight": "Bolder",
 "style": "heading",
 "spacing": "Large",
 "separator": true
 },
 {
 "type": "ColumnSet",
 "columns": [
 {
 "type": "Column",
 "width": "stretch",
 "items": [
 {
 "type": "Input.Text",
 "placeholder": "Please enter a UK mobile Number",
 "maxLength": 75,
 "id": "recipient",
 "label": "To",
 "errorMessage": "Please enter a UK mobile Number",
 "regex": "^\\+447\\d{7,9}$",
 "style": "Tel",
 "value": "@{variables('Caller Number')}",
 "isRequired": true
 },
 {
 "type": "Input.Text",
 "placeholder": "Please enter your message here",
 "isMultiline": true,
 "maxLength": 455,
 "id": "content",
 "label": "Message",
 "isRequired": true,
 "errorMessage": "Please write your message."
 }
 ]
 }
 ]
 },
 {
 "type": "ActionSet",
 "actions": [
 {
 "type": "Action.Submit",
 "title": "Cancel"
 },
 {
 "type": "Action.Submit",
 "title": "Send",
 "style": "positive"
 }
 ],
 "horizontalAlignment": "Right"
 }
 ]
}
 
 

Parse the Json

Description  Screenshot
  • Add a Parse JSON action
  • Set content to Body from the adaptive card response. Use a schema of: 
{
 "type": "object",
 "properties": {
 "responseTime": {
 "type": "string"
 },
 "responder": {
 "type": "object",
 "properties": {
 "objectId": {
 "type": "string"
 },
 "tenantId": {
 "type": "string"
 },
 "email": {
 "type": "string"
 },
 "userPrincipalName": {
 "type": "string"
 },
 "displayName": {
 "type": "string"
 }
 }
 },
 "submitActionId": {
 "type": "string"
 },
 "messageId": {
 "type": "string"
 },
 "messageLink": {
 "type": "string"
 },
 "data": {
 "type": "object",
 "properties": {
 "recipient": {
 "type": "string"
 },
 "content": {
 "type": "string"
 }
 }
 }
 }
}

Add a Set Variable action. Set:

  • Name = Message
  • Value = Body Content from Parse JSON

 

Add a Twilio send Text Message (SMS) action* 

 

✅ * This requires a Twilio account and you need to authenticate with to use this service. Of course you can substitute this with any service you like

 

Set the following:

  • From Phone Number = Select from the drop down of your available numbers in Twilio 
  • To Phone Number = @body('Parse_JSON')?['data']?['recipient'] 
  • Text = Message Variable 

 

Table of Contents