web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / changing colour of the...
Power Automate
Answered

changing colour of the adaptive card text @output if it matches certain strings

(0) ShareShare
ReportReport
Posted on by 15

Hi, hope I'm posting this in the right place as I don't see a board specifically for adaptive cards.

 

I have a flow which takes an email and isolates some text values which are then used in an adaptive card in Teams.

 

the part of the card which displays the text looks like this:

 

{
"type": "TextBlock",
"spacing": "None",
"text": "PLAN: @{outputs('splitPlan')}",
"isSubtle": true,
"wrap": true
},
 
I'd like to set the colour to red if the value of @{outputs('splitPlan')} contains specific strings - either the output contains 'premium' or 'dedicated'
 
I've been trying to add a 'color' line something like
 
"color": "${if(@{outputs('splitPlan')}) contains('premium'|'dedicated'), 'attention', 'good')}",
 
any help appreciated!
Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @neca7 ,

     

    Please try this

    {
     "type": "AdaptiveCard",
     "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
     "version": "1.2",
     "body": [
     {
     "type": "TextBlock",
     "spacing": "none",
     "text": "ABC",
     "isSubtle": true,
     "wrap": true,
     "color": "@{if( or( contains(outputs('splitPlan'),'premium'),contains(outputs('splitPlan'),'dedicated')),'attention','good')}"
     }
     ]
    }

     

    Best Regards,

    Wearsky

  • neca7 Profile Picture
    15 on at

    @v-xiaochen-msftthat works great! thank you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard