How to post an adaptive card to Microsoft Teams?

Lukas16
Tera Contributor

Hey guys,

I'd like to post a message in form of a customized card to a specific MS Teams channel whenever a knowledge article is created/updated. I tried doing so in flow designer/integrationhub (starter package/MS Teams spoke) using a webhook url.

find_real_file.png

Here I can only send a simple text message to MS Teams though.

Now I'm kind of stuck since I'm relatively new to ServiceNow. Can I somehow modify the "message" field to send a JSON object to the webhook url resulting in an adaptive card?

Any ideas how to accomplish this matter?

Thanks in advance!

Lukas

5 REPLIES 5

sachin_namjoshi
Kilo Patron
Kilo Patron

You will have to configure script step in your flow to achieve this.

You can call external webhook via REST message and then send data in JSON format.

Take a look into below article

 

https://community.servicenow.com/community?id=community_article&sys_id=35f7d53ddb2ed3800be6a345ca961...

 

Regards,

Sachin

Lukas16
Tera Contributor

Thanks for your answer Sachin!

So here is a little follow up:

Via MS Teams webhook url, apparently you can only send message cards, not adaptive cards: https://docs.microsoft.com/de-de/microsoftteams/platform/task-modules-and-cards/cards/cards-referenc...

The Microsoft Teams Spoke for Integrationhub is kind of limited here because a script include just creates a basic message card based on the filled field values in the picture below:

find_real_file.png

To add buttons, images, texts etc. to the message, you'd have to create your own message card within an action which includes:

1. Script step (define the JSON object you'd like to send to the webhook url) + inputs and outputs

2. REST step (send the stringified JSON object (output of step 1) to the webhook url

Now I'm trying to figure out if it's possible to send something back to servicenow (within the sent message card in MS Teams) for example directly add a comment to the knowledge article as seen in the following picture:

find_real_file.png

Regards

Lukas

Hi @Lukas,

Can you please suggest like how you are capturing the data from Teams to ServiceNow. For example: When you are adding a comment in the Knowledge article getting displayed in Teams, that comment needs to get added at Knowledge article in ServiceNow.

Any suggestions would help. Thanks in advance!

Good Afternoon,

Did you make any progress with this in the end?

Kind Regards

Ashley