cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bongobus1
Level: Powered On

checkbox

how do i have a lable show the total number of checkboxs ticked

 

so if 3 out of 5 checkbox values are true the lable equals 3

 

if 5 checkbox values are true then the label equals 5

2 ACCEPTED SOLUTIONS

Accepted Solutions
mr-dang
Level 10

Re: checkbox

@bongobus1

The state of true resolves to a value of 1. If you were to sum up Checkbox1.Value, Checkbox2.Value, and Checkbox3.Value, where #1, and #2, are true, then you would get an answer of 2.

 

So you can use:

Sum(Checkbox1.Value, Checkbox2.Value, Checkbox3.Value)

Let me know if that works for you.

Microsoft Employee
@8bitclassroom
bongobus1
Level: Powered On

Re: checkbox


@KroonOfficeSol wrote:
Read all my posts and think for yourself, you will manage then to find your solution.

Hint: you replace value

sorry dont get it - replace value with what ?

14 REPLIES 14
mr-dang
Level 10

Re: checkbox

@bongobus1

The state of true resolves to a value of 1. If you were to sum up Checkbox1.Value, Checkbox2.Value, and Checkbox3.Value, where #1, and #2, are true, then you would get an answer of 2.

 

So you can use:

Sum(Checkbox1.Value, Checkbox2.Value, Checkbox3.Value)

Let me know if that works for you.

Microsoft Employee
@8bitclassroom
bongobus1
Level: Powered On

Re: checkbox

perfect - now how do i make the background of the label go red when 9 is met ?

bongobus1
Level: Powered On

Re: checkbox


@bongobus1 wrote:

perfect - now how do i make the background of the label go red when 9 is met ?


apologies meant 9 or more

mr-dang
Level 10

Re: checkbox

There's a few ways to do this.

 

We already have the sum of the checkboxes in Label1.

 

If we want the color of the text to change to red, you would go to the Color property of Label1 and place a condition:

If(Value(Label1.Text)>=9, Red, Black)

This means, "If the value of Label1 is greater than or equal to 9, then make the text color red, otherwise black."

 

So the If statement works very similarly to Excel.

Microsoft Employee
@8bitclassroom
bongobus1
Level: Powered On

Re: checkbox


@mr-dang wrote:

There's a few ways to do this.

 

We already have the sum of the checkboxes in Label1.

 

If we want the color of the text to change to red, you would go to the Color property of Label1 and place a condition:

If(Value(Label1.Text)>=9, Red, Black)

This means, "If the value of Label1 is greater than or equal to 9, then make the text color red, otherwise black."

 

So the If statement works very similarly to Excel.


 

yep that worked nicely i used a circle to fill the color based on the label value

 

now to tweek

 

if the value is between 0 and 7 - fill green

8 to 13 - yellow

14 - 20 red

 

how is this acheived ?

KroonOfficeSol
Level 10

Re: checkbox

If(value >=14 , red, value >=8, yellow, green)
bongobus1
Level: Powered On

Re: checkbox


@KroonOfficeSol wrote:
If(value >=14 , red, value >=8, yellow, green)

i have a label so this didnt work for me

KroonOfficeSol
Level 10

Re: checkbox

Value(Yourlabel.text) >= 14
bongobus1
Level: Powered On

Re: checkbox


@KroonOfficeSol wrote:
Value(Yourlabel.text) >= 14

this only works for 1 condition not 3 so how do i correct ? 0-7 Green, 8-13 Yellow, 14-20 Red.

 

If(Value(Label9.Text)>=14,Red,Yellow)

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 40 members 4,016 guests
Please welcome our newest community members: