cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
saialkesh
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

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

 

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

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

Thank you. This works 🙂

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (47,833)