cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tricky778
Level: Powered On

Conditionally changing the colour of a gallery label

Hi PowerApps community, 

I have a custom gallery with a text label looking at ThisItem.'form status'. This correctly shows me the text present in the 'form status' text field within my SharePoint list (looking at previously submitted forms). 

 

I would like to conditionally change the text colour, so for example...if the contents of that field contains the text "Approval Stage 2 - Pending" show in orange, "Approved" - show in green. Everything else show in black text. 

 

 I've been trying to use the following IF statement on the 'Color' property for that label to no avail:

 

If(ThisItem.'Form Status' = "Approval Stage 2 - Pending", Orange, Black)

 

Can someone please point me in the right direction? 

 

Screenshot attached ('details visible are test records only').

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Conditionally changing the colour of a gallery label

Hey @Tricky778 

 

Can you check if ThisItem.'Form Status' is returning the correct value?

Also, can you try to update the expression as:
If(Text(ThisItem.'Form Status') = "Approval Stage 2 - Pending", Orange, Text(ThisItem.'Form Status') = "Approved",Green,Black)

Make sure that there are no extra spaces in the returned value and passed text.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Conditionally changing the colour of a gallery label

Hey @Tricky778 

 

Can you check if ThisItem.'Form Status' is returning the correct value?

Also, can you try to update the expression as:
If(Text(ThisItem.'Form Status') = "Approval Stage 2 - Pending", Orange, Text(ThisItem.'Form Status') = "Approved",Green,Black)

Make sure that there are no extra spaces in the returned value and passed text.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Tricky778
Level: Powered On

Re: Conditionally changing the colour of a gallery label

Thanks @yashag2255 ,

 

I didn't realise my gallery had chopped 'Approval' off the end. So the correct text should have been "Approval Stage 2 - Pending Approval". Working perfectly now

 

👍

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,230)