cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alygator
Microsoft
Microsoft

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

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)

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

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.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

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

Thank you @WarrenBelz 👍🏽

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,241)