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 Apps / How to add text variab...
Power Apps
Answered

How to add text variable as well as color switch on label

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, could you advise on the syntax to enable me to switch between two strings of text depending on the text values that are stored in the SharePoint list, in combination with the color-switch that is already in place on the label - described below and in screenshot attached?

If the value in the data source is "Available" I need to show the string "Available" value in the label, in a green color. If the value is anything other than "Available" (because there are all sorts of other possible values in this field in SharePoint) I simply want the text in the label to show as "Not Available" in a grey color. I need to add this to existing properties on the label: 
If(ThisItem.MatchStatus.Value<>"Available",DarkGray, Green)

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,075 Most Valuable Professional on at

    Hi @alygator ,

    You have two settings on the Label to adjust - the Color

    If(
     ThisItem.MatchStatus.Value = "Available",
     Green,
     DarkGray
    )

    and the Text

    If(
     ThisItem.MatchStatus.Value = "Available",
     "Available",
     "Not Available"
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • alygator Profile Picture
    Microsoft Employee on at

    Thank you @WarrenBelz 👍🏽

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard