cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elitezone
Post Prodigy
Post Prodigy

Change color depending on the count

Hello,

 

In a previous topic I got a code:

 

 

"Total Amount of Propositions: " & 
With(
{wZone:IdeaBox_1}; 
CountRows(wZone)
)

 

This sums up all my Sharepoint list records and print it, so the users can see that there are propositions.

 

Is it possible to make this code change Color depending on the amount that CountRows(wZone provide)?

 

I tried to edit color section, but it didn't work. I have no Ide how to link a CountRows wZone with a Color.

I would love to have default color for value - 0 white, and every other value light red.

 

Is it possible to make in such a scenario?

17 REPLIES 17
leyburn19
Memorable Member
Memorable Member

In the color property put something like;

 

If(CountRows(wZone)=?,Black,If(CountRows(wZone) <0, Red, If(CountRows(wZone)=?,Blue)))

 

The above will change teh text Color based on results you want.  Just edit them

@leyburn19 

I use ; as delimiter.

This function does not work:

 

If(CountRows(wZone)=0;White;If(CountRows(wZone) <0; Red))

I placed in in the Color section, and I am receiving such an errors:

Name is invalid

Function CountRows does have invalid arguments.

 

can you do a screen shot of your "color section"

Elitezone_1-1600166646278.png

Maybe wZone isn't recognized because it does not exist? It is created solely for the count formula? 

 

Elitezone_2-1600166725656.png

Translation: Function CountRows does have an invalid arguments.

Name is invalid. ID was not recognized.

 

 

 

Sorry,  I thought wZone was teh data source.  Replace it with the name of teh SP list you want to count

Ok,  my fault.  you want the Total column field be a different color based on value. Then you could try:

 

If(Value(SumField.Text)>0,White,Red)

 

Sumfield is the nam eof teh Textinputbox or Label you are using to sum the Column.  

It works. Thanks.

Is it possible to change a color only of the value of this label, not whole label?

"List of propositions made today: " & 
With(
   {
      wSubmitted:
      Filter(
         IdeaBox_1.Utworzony; 
         IsToday(Utworzony)
      )
   };
   CountRows(wSubmitted)
)

I would love to have only number condtionally in Red, and "List of propositions" in white always.

Or should I create two labels - one with number, and other with name "List of propositions"

Should be the same with all labels and controls.  You can change fill, borders etc

After more tests I believe that this does not work...

 

If(Value(Label6_1.Text)>5;Red;White)

No matter the Value in Label6_1 the color is always White.

When I change the formula to White;Red the color is always Red. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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