cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PAB
Advocate IV
Advocate IV

If Statement for Fill Color in Circles

Hi,

 

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.

Error:

colorerror.PNG

No Error:

ColorNoError.PNG

4 REPLIES 4
Meneghino
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

Meneghino
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

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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