cancel
Showing results for
Did you mean:
Helper I

## 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
Community Champion

@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
Helper I

@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
Community Champion

@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
Helper I

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

Helper I

@bongobus1 wrote:

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

apologies meant 9 or more

Community Champion

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
Helper I

@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 ?

Resident Rockstar
If(value >=14 , red, value >=8, yellow, green)
Helper I

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

i have a label so this didnt work for me

Resident Rockstar
Value(Yourlabel.text) >= 14
Helper I

@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)

Announcements

#### Copilot Cookbook Challenge | Week 1 Results | Win Tickets to the Power Platform Conference

We are excited to announce the "The Copilot Cookbook Community Challenge is a great way to showcase your creativity and connect with others. Plus, you could win tickets to the Power Platform Community Conference in Las Vegas in September 2024 as an amazing bonus.   Two ways to enter: 1. Copilot Studio Cookbook Gallery: https://aka.ms/CS_Copilot_Cookbook_Challenge 2. Power Apps Copilot Cookbook Gallery: https://aka.ms/PA_Copilot_Cookbook_Challenge   There will be 5 chances to qualify for the final drawing: Early Bird Entries: March 1 - June 2Week 1: June 3 - June 9Week 2: June 10 - June 16Week 3: June 17 - June 23Week 4: June 24 - June 30     At the end of each week, we will draw 5 random names from every user who has posted a qualifying Copilot Studio template, sample or demo in the Copilot Studio Cookbook or a qualifying Power Apps Copilot sample or demo in the Power Apps Copilot Cookbook. Users who are not drawn in a given week will be added to the pool for the next week. Users can qualify more than once, but no more than once per week. Four winners will be drawn at random from the total qualifying entrants. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once. If they are drawn multiple times, another user will be drawn at random. Prizes:  One Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 (\$1800 value, does not include travel, lodging, or any other expenses) Winners are also eligible to do a 10-minute presentation of their demo or solution in a community solutions showcase at the event. To qualify for the drawing, templates, samples or demos must be related to Copilot Studio or a Copilot feature of Power Apps, Power Automate, or Power Pages, and must demonstrate or solve a complete unique and useful business or technical problem. Power Automate and Power Pagers posts should be added to the Power Apps Cookbook. Final determination of qualifying entries is at the sole discretion of Microsoft. Weekly updates and the Final random winners will be posted in the News & Announcements section in the communities on July 29th, 2024. Did you submit entries early?  Early Bird Entries March 1 - June 2:  If you posted something in the "early bird" time frame complete this form: https://aka.ms/Copilot_Challenge_EarlyBirds if you would like to be entered in the challenge.   Week 1 Results:  Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Copilot Cookbook Gallery:Power Apps Cookbook Gallery:1.  @Mathieu_Paris 1.   @SpongYe 2.  @Dhanush 2.   @Deenuji 3.  n/a3.   @Nived_Nambiar  4.  n/a4.   @ManishSolanki 5.  n/a5.    n/a