In this use case we want to tackle the following scenarios:
- When a voice message is received in Nimbus, we want to send out the link per email to whom it concerns.
- When a voice message is received in Nimbus, the Teams team receives an Adaptive Card in the General channel with the link to the recorded voice message. We want to read that link and forward it via email.
Show a preview of the flow...
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. |
How-To Steps
NOTE CHANGES EFFECTIVE IN MANY MICROSOFT TENANTS
Due to changes already effective in many Microsoft tenants, you might need to use ['body'][0]['attachments'][0]['content'] instead of ['body/attachments'][0]['content']. So, for example, the json for the voicemail URL would look like this:
json(triggerOutputs()?['body'][0]['attachments'][0]['content'])['actions'][0]['url']
instead of
json(triggerOutputs()?['body/attachments'][0]['content'])['actions'][0]['url'].
Start your flow with a Teams trigger
- Create an automated cloud flow and start with the MS Teams trigger "When a new channel message is added".
Enter:- Team = Your Nimbus Team name
- Channel = "General" as per default in Nimbus
Initialize variable
-
Add a "Initialize Variable" element with the following details.
- Name = VoiceMessageUrl
- Type = String
-
Value = json(triggerOutputs()?['body/attachments'][0]['content'])['actions'][0]['url']
💡You might need to use ['body'][0]['attachments'][0]['content'] instead of ['body/attachments'][0]['content'].
Add a condition
-
Now validate if the VoiceMessageUrl is not empty by adding a "Condition" element to the flow with the following configuration:
- length(variables('VoiceMessageURL'))
- is greater than
- 0
Send email
- Within the "If yes" branch, add an Outlook 365 "Send an Email (V2)" element to the flow and add the following values:
-
Subject= json(triggerOutputs()?['body/attachments'][0]['content'])['body'][2]['items'][0]['text']
💡You might need to use ['body'][0]['attachments'][0]['content'] instead of ['body/attachments'][0]['content']. -
Body = You can download the voicemail variables('VoiceMessageURL')
-
Subject= json(triggerOutputs()?['body/attachments'][0]['content'])['body'][2]['items'][0]['text']
Other values from the Teams channel message you may want to add to the Email are:
Value | Expression |
---|---|
Voicemail URL |
💡You might need to use ['body'][0]['attachments'][0]['content'] instead of ['body/attachments'][0]['content']. |
Call ID |
💡You might need to use ['body'][0]['attachments'][0]['content'] instead of ['body/attachments'][0]['content']. |
Card ID |
💡You might need to use ['body'][0]['attachments'][0]['content'] instead of ['body/attachments'][0]['content']. |
Card Text |
💡You might need to use ['body'][0]['attachments'][0]['content'] instead of ['body/attachments'][0]['content']. |
Test your flow
Scenario: Voicemail received in Nimbus
- In Nimbus create a workflow named "Voicemail only" and assign it to your service via the service settings. The service will now always ask for a voice message and send an adaptive card to the Teams channel.
- Call the service to test your flow. → You should see the Adaptive Card being created in the channel
- You should also see the Email in your "Sent Items" folder in Outlook:
Scenario: Not a voicemail message
💡 If you send any other message to the "General" channel in Teams, your flow will run into an error in step 2. This error can be ignored.