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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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