Showing results for 
Search instead for 
Did you mean: 
Advocate III
Advocate III

If Statement for Fill Color in Circles



I never got these errors before yesterday and now I am trying to fix the errors by changing all the colors to Color.Yellow etc. The original statement had the same If statement for both but except the color was just by itself like this:

If(Subtitle1_1.Text="Light Green",LightGreen,Subtitle1_1.Text="Yellow",Yellow,Subtitle1_1.Text="Green", Green, Subtitle1_1.Text="Gray",Gray,Subtitle1_1.Text="Red",Red,Black)


There is nothing different between the two statements besides the fact that they are on a different screen. They are both if statements to fill a color based on the value of a field. Let me know if you can figure out what is causing the issue because I do not see the difference.



No Error:


Community Champion
Community Champion

hi @PAB, what is the text of the error message?

Error Message:

The function "If" has some Invalid arguments

Invalid use of '.'

error message.png

Community Champion
Community Champion

I am stumped, but try with just one branch of the if and different variants, with or without the Color. and also RGBA.

One if statement does not work either with the Color.Yellow however it does work with the RGBA but if the rest of my app is coded with Color.Yellow I don't understand why it will not work in this case. It seems a little buggy to me that when they pushed out this update it started throwing an error on every single screen that I had done like this even though it was working before and now the same statement on different screens won't work.

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,056)