cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Change Icon color based on a choice value

Hi

I have dropdown called as Financial Impact with values - Low, Medium, High & Very High in SP List

I have a clearcollect on my gallery screen and collection name is germcollection

In Gallery screen, i have a search button referencing the collection and fields are displayed in Gallery, based on search provided.

In the Gallery view, where i have the value of Financial Impact displayed as Text (Low), i want to display a icon instead of text for the Financial Impact. If the value is Low, icon color should be Green, Medium - Brown, High - Red & Very High - Dark Red.

 

I tried adding an icon circle & gave the following in the Fill properties of Circle:

If(ThisItem.'Financial Impact'.Value="Low",Color.Green,Color.Red)

This doesnt work...

Can someone please help me in getting this achieved. 

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

OK Thanks @saialkesh ,

If you put in a label with

ThisItem.'Financial Impact'.Value

do you see the value you are expecting? You could also try

Switch(
   ThisItem.'Financial Impact'.Value,
   "Low", Green, 
   "Medium", Brown, 
   "High", Red
   "Very High", DarkRed
)

Your code should work although Fill is not the colour of the icon, it is the background.

 

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

4 REPLIES 4
Highlighted
Super User III
Super User III

Hi @saialkesh ,

You do not need the Value.

If(
   ThisItem.'Financial Impact'="Low",
   Color.Green,
   Color.Red
)

 

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.

 

Highlighted

Dear @WarrenBelz 

 

Thank you for the quick revert.

The reason i included Value is 'cos the field is a dropdown set of values. If i type the syntax without values, it still doesnt work.

I also tried the following:

If(

"Low" in ThisItem.'Financial Impact'.Value, Green,

"High" in ThisItem.'Financial Impact'.Value, Red,

Black

)

 

but same result....it doesnt work. I apply the following expression in the fill property of the icon

 

Appreciate your help

Highlighted

OK Thanks @saialkesh ,

If you put in a label with

ThisItem.'Financial Impact'.Value

do you see the value you are expecting? You could also try

Switch(
   ThisItem.'Financial Impact'.Value,
   "Low", Green, 
   "Medium", Brown, 
   "High", Red
   "Very High", DarkRed
)

Your code should work although Fill is not the colour of the icon, it is the background.

 

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

Highlighted

Thank you. This works 🙂

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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