cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Checkbox Count

Hello Everyone,

 

I'm super new to PowerApps but I think I've got a very simple requirement and I've been breaking my head over this since yesterday. I've got two galleries. Gallery 1 filters gallery 2. I'm using a groupby on gallery 1 and gallery 2. Also gallery 2 has a single checkbox and once that checkbox is selected I'd like to display the count of rows for the check boxes selected against each item in gallery 1. Also when a user checks and then unchecks a checkbox the count should decrease by 1.  I did do a lot of googling however these weren't helping me. A few solutions that I tried kept giving me a circular reference error. Would really appreciate any help.

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Bilbash ,

I will attempt to help here - but until your last post (I started reading from the start as well), I was also somewhat confused as to what you needed. Your code

AddColumns(
   GroupBy(
      Filter(
         Table2,
         Areas=Gallery3_1.Selected.Areas
      ),
      "Areas",
      "Questions",
      "Risk_x0020_Solar_x0020_System",
      "Riskarea"
   ),
   "Count1",
   CountRows(Riskarea)
)

is grouping a table by three fields (Areas, Questions and 'Risk Solar Systems') and then counting the resulting rows. I am assuming you are needing the three for display and only one (the lowest level) is needed for the CountRows function, however this is not relevant to your issue,

You are filtering on the table, so you cannot further filter on a control in a gallery as it is unrelated to the filter. If however you were to write this value to this table (it would have to be on all matching records in the Group), you could filter on this.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

10 REPLIES 10
Super User III
Super User III

@Bilbash 

A picture is worth a thousand words.  If you could provide a screenshot of the app it would be easier give advice here.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hello,

 

Thanks for the super quick response. Screenshot below. The top gallery in the screenshot filters the bottom gallery. The bottom gallery contains the checkbox and when selected/unselected I'd like to count the rows in a label against each item in gallery 1.

 

Screenshot of app. Top gallery filters gallery 2. Gallery 2 has the checkbox and once checkbox is selected I'd like a label that counts the rows checked besides each item in gallery 1Screenshot of app. Top gallery filters gallery 2. Gallery 2 has the checkbox and once checkbox is selected I'd like a label that counts the rows checked besides each item in gallery 1

 

AddColumns(GroupBy(Table2,"Risk_x0020_Solar_x0020_System","Riskuni"),"Count",CountRows(Riskuni))

The Item property formula for gallery 1 is shown above. 

 

Thanks!

 

 

@Bilbash 

I'm wanting to understand this statement here.

 

"The bottom gallery contains the checkbox and when selected/unselected I'd like to count the rows in a label against each item in gallery 1"

 

Where are the 'rows in a label'?  I guess it would be understood if you showed a sample of how the count should work.

@mdevaney . Thank you again for the super quick response.

 

Ok, so apologies if I haven't given enough information. I'm basically designing a questionnaire. The questionnaire has two levels of hierarchy, one is the Domain and the other is the area. Items in Gallery 1 in the screenshot contain the question domains. Gallery 2 contains the question Areas and these question areas are filtered based on the selection from gallery 1. I have another gallery inside gallery 2 which contains the questions since one question area can have multiple questions. This third gallery has the checkbox against each question. When a user is filling up the questionnaire, I'd like to keep track of how many questions have been answered and how many have been pending against each Domain in gallery 1. Hence for this reason I want to add a label that shows me the number of questions answered. In the screenshot above, Gallery 1 already has a label, this is showing the total number of questions. I'd now like to see the number of questions answered.

 

Thanks! 

 

 

@Bilbash 

I am having a difficult time following your problem statement.  Perhaps this is due to complexity of the problem.

 

There are a few ways you can help me to understand:


* Describe it with pictures

* Show a specific example rather than general process

* Ask the smallest question possible

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Sound slide you need a collection of answers that chas the following columns. Question domain, area, question, answer.

Then you can count each one of those fields based on the answer. 

 

Have you done app in a day? That course has examples of how to collect checkbox ticks and remove them on uncheck.

 

Agree 100% with Matt, we could do with a better description, simply state each part of the app with screens and items code so we can see the schema.

 

 

@mdevaney 

 

Will try again. 

 

Numbers in black circle within Gallery 1 is a simple countrows. I want the numbers in the red circles to be updated (with a count of number of questions answered) as soon as someone checks the checkbox in gallery 2 (highlighted in green)

 

Numbers in black circle within  Gallery 1 is a simple countrows. I want the numbers in the red circles to be updated as soon as someone checks the checkbox in gallery 2 (highlighted in green)Numbers in black circle within Gallery 1 is a simple countrows. I want the numbers in the red circles to be updated as soon as someone checks the checkbox in gallery 2 (highlighted in green)

Frequent Visitor

Hi Experts,

 

I'm still stuck on this issue and am hoping to get some help on this please. 

 

I've got three galleries -

 

Gallery 4 (Items Property below) and within that I've got three labels referencing the below fields

AddColumns(GroupBy(Table2,"Risk_x0020_Solar_x0020_System","Riskuni"),"Count",CountRows(Riskuni))

 

Gallery 3_1 (Items Property below) and within that I've got three labels as well

AddColumns(GroupBy(Filter(Table2,'Risk Solar System'=Gallery4.Selected.Risk_x0020_Solar_x0020_System),"Areas","Riskarea"),"Count1",CountRows(Riskarea))

 

Gallery 13_1 (Items property below) and within that I've got a checkbox two labels and a slider

AddColumns(GroupBy(Filter(Table2,Areas=Gallery3_1.Selected.Areas),"Areas","Questions","Risk_x0020_Solar_x0020_System","Riskarea"),"Count1",CountRows(Riskarea))

 I want to have a label in Gallery 4 that counts the items that have been "checked" in Gallery 13_1. Screenshot of app attached.

 

I've been stuck on this for quite some time, so any help will be appreciated.

Hi @Bilbash ,

I will attempt to help here - but until your last post (I started reading from the start as well), I was also somewhat confused as to what you needed. Your code

AddColumns(
   GroupBy(
      Filter(
         Table2,
         Areas=Gallery3_1.Selected.Areas
      ),
      "Areas",
      "Questions",
      "Risk_x0020_Solar_x0020_System",
      "Riskarea"
   ),
   "Count1",
   CountRows(Riskarea)
)

is grouping a table by three fields (Areas, Questions and 'Risk Solar Systems') and then counting the resulting rows. I am assuming you are needing the three for display and only one (the lowest level) is needed for the CountRows function, however this is not relevant to your issue,

You are filtering on the table, so you cannot further filter on a control in a gallery as it is unrelated to the filter. If however you were to write this value to this table (it would have to be on all matching records in the Group), you could filter on this.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (38,740)