Tips and tricks to create stunning Adaptive Cards (Updated Mar ’22)

A simple Adaptive Card for your business takes less than 10 minutes to make. But as you start to make more sophisticated layouts you will usually run into common issues where the data you want to show in your Card maybe isn’t 100% what you need it to be, or is just too much to comfortably fit into your layout.

In this post I listed examples of cool little hacks that we’ve accumulated over time that helped push the envelope on what an Adaptive Card can do. Some of these use Adaptive Expressions, but others are just thinking outside the box a little.

Trim to first name

Let say you have an API that gives you the user’s name as “John Hancock” but you want to address the user as just “John” in your Card.

Turn timestamps into “x hours ago”

Most APIs send timestamps in UNIX format, like 2021-09-17T00:00:33.25. But most users prefer relative timestamps to be a little easier to read than that.

Ordinarily you need a library like moment.js that does this kind of transformation. But, in a pinch, you can get very close to this using the following Adaptive expression.

Assemble email addresses

If you want to show a user’s email address, but your API isn’t providing it, then maybe you can “build” the email using their name and company name.

Make tabs

Tab interfaces are popular, but not supported in Adaptive Cards. Or are they?

With this trick you can create a Card that has at least two tabs – although be warned that the widths need tinkering with to display this properly on small screens.

Include icons in the Card

Adaptive Cards can’t host their own images or icons, so you will usually need a URL and capacity to host these yourself elsewhere (for example through a CMS). However, there is one hack to get around this that works at least for icons. You can base64 them, for example with a tool like Elmah.

This makes the Card’s payload quite large so use it with caution and remember that some host apps might have size restrictions that you could run into using this.

Conditional highlighting

If you want text to be either green or red depending on a value, you can conditionally highlight text, or, even switch out arrow symbols to show an upwards or downwards trend. In our example below this is the values we used:

"change": "2.5",
"yesterday": "7"

Create fallback text

Sometimes the data you get from APIs is not as uniform as we want. Let’s say you want to make a Card that shows peoples’ job titles beneath their name. Until one record doesn’t contain the job title, causing an awkward change in height.

Wouldn’t it be cool to have a fallback of some kind, say to show the email address when there isn’t a job title?

Create a mini timeline

Whether your showing customer activity or progress of a process, a vertical timeline could be a quirky little addition to your Adaptive Card design. Here’s how to do it:

Use backgrounds for stunning designs

Whether it’s a welcome message, or some digital signage you want to place on the corporate intranet, Adaptive Cards can show background images which make them ideal for your great designs.

Expanding line items

In order to declutter an Adaptive Card, it might be useful to offload some details into a little section that expands and collapses. This is a relatively simple way to get there:

Accordion

Building on top of the expand/collapse function, you could also get whole accordion style sections. Whenever you click on a headline, the respective section opens or closes.

Pseudo active state

Let’s say you want to offer a Like button. On Facebook you press it, it turns bright blue, you know it’s pressed. Adaptive Cards’ buttons don’t offer a similar activated state, but you can get there by using the Action.ToggleVisibility button.

Filtered lists

You know the problem: you get a JSON file that has 25 items but you only want to show the ones that are, say, green. With an Adaptive Expression you can filter items from your array based on a matching attribute.

Turn an integer into a string

Let’s say your JSON has a count of the number of outages your system has. But you can’t show this count inside of your Adaptive Card because it’s just an integer, and Adaptive Cards can only bind to strings wrapped in "".

Rescue has arrived. There is an Adaptive Expression you can inside of your Card that turns your integer into a string.

Count items in an array

Let’s say you have a list but you want to get a count of how many of them are red items, versus other colors. You can wrap this into two Adaptive Expressions, the first count is responsible to output you a number, and the inner function where filters the output for the attribute(s) you specify.

Empty state for a list

If you have an Adaptive Card list but the array is empty, the list just unceremoniously vanishes. This could make you or your users question if the Card could be broken, when it’s just hasn’t anything to show you. To avoid that, empty states are a popular way to signpost a list is deliberately empty.

In this below example, if there are no 🟡 items in our list, we display the empty state container.

~~~

Did you find these hacks useful? If so, you might also be interested in ready-to-use business templates for Adaptive Cards.

Related Posts
Read More

5 tools that let you slash your Enterprise SaaS license costs

In today’s digital workplace, many businesses rely on Line-of-Business (LOB) applications or B2B SaaS platforms like Workday, Zendesk, and ServiceNow for their operations. While these tools are essential, their per-user licensing costs can become a significant burden, especially as teams grow. However, by integrating these tools with automation platforms like Zapier or Power Automate, companies can extend the visibility and functionality of their software without needing to buy a license for every individual user. For instance, a popular use case for Zapier is to automate customer support tickets between Zendesk and Slack, enabling the whole team to monitor ticket statuses…
Read More

6 benefits of introducing a smart assistant to your workplace

We’re very passionate about creating a digital workplace that delights users. Unsurprisingly for a software company, our websites are laden with features and technical specifics; such as APIs, AI chatbots or Adaptive Cards. But, at a more fundamental level, what are these features adding up to? What benefits can your organization expect in the long run? In this post I want to elaborate on the benefits that make your time – evaluating and investing into an intelligent workplace – worthwhile. Cut down on tab hopping Did you know the average worker regularly uses 36 applications, sometimes jumping between a dozen…
Read More

Embed RSS news feed web part into SharePoint or Viva Connections (Updated 2025)

Despite first being released in 1999 (yeah, a quarter of a century ago) RSS feeds are still a go-to format to syndicate news from different sources. This makes it also an ideal tool to show local news, weather, traffic updates, and more to users of your intranet. SharePoint used to offer a built-in RSS reader web part, but it was broken for many years until it was removed in 2024 alongside other SharePoint Connectors. From the SharePoint store: RSS feeds web part Luckily there is an easy replacement available directly on Microsoft AppSource: RSS feed web part for SharePoint. It’s…
Read More

Ask ChatGPT to get updates from your work apps

We’re happy to announce that our ChatGPT waitlist is now finished and all users can now start to use our adenin GPT chatbot. Simply head over to our channel and follow the Open adenin GPT button to get started. Using adenin GPT is the first time you can conveniently connect dozens of work and intranet apps, such as SharePoint, ServiceNow, Salesforce, Zendesk, and many others, to your ChatGPT account. Using ChatGPT for work is ideal for organizing your tasks as it can reduce the number of tabs you have to keep open in order to monitor your work apps. In…