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

Notifications

Announcements

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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 339 Super User 2025 Season 2

#1
trice602 Profile Picture

trice602 339 Super User 2025 Season 2

#3
David_MA Profile Picture

David_MA 270 Super User 2025 Season 2

Last 30 days Overall leaderboard