cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Count - Radio Buttons that return a value - on the form/app - before submitting - just like InfoPath

Hi,

How do I go about counting 160 Radio buttons to see if they have a value in an app - real time or close to it - as it is filled out? - like before it is submitted/uploaded

Yes/No/NA

In InfoPath we can use count(), but powerapps does it differently?

 

Say I have an audit form with 16 sections 1.0 thru 16.0.

Radio Buttons rbtn1_1, rbtn1_2 ......... rbtn16_10

Radio Button can have a value of Yes/No/NA.

 

I wish to be able in real time, or button push show the user how many sections / radio buttons have been selected, less those that are not applicable (NA) and are "Yes" as a percentage of the total selected. That value is also stored on the form.

Count those that have a value.

Count how many are NA

Count how many are yes

Then create a percentage.

 

But have to start where?

A collection?

 

Where does one start?

1 ACCEPTED SOLUTION

Accepted Solutions
HadynM
Responsive Resident
Responsive Resident

Hi @Anonymous 

 

With only knowing what you have posted, start with a collection.

ClearCollect(
    colAuditQuestions,
    {
        Section: 1,
        Question: 1,
        QuestionText: "Question goes here",
        Answer: "NA"
    },
    {
        Section: 1,
        Question: 2,
        QuestionText: "Question goes here",
        Answer: "NA"
    },
    {
        Section: 1,
        Question: 3,
        QuestionText: "Question goes here",
        Answer: "NA"
    },
    ...,
    {
        Section: 1,
        Question: 10,
        QuestionText: "Question goes here",
        Answer: "NA"
    }
)

Then add a gallery to a page connected to this collection.
Add the appropriate controls to allow the users to answer the questions.
The radio control OnChange = Patch(colAuditQuestions,ThisItem,{Answer:Radio2.Selected.Value})
Then add some controls that show the stats you want for the summary as per below.
sample.JPG

Hope that helps get you started.

Cheers Hadyn

View solution in original post

1 REPLY 1
HadynM
Responsive Resident
Responsive Resident

Hi @Anonymous 

 

With only knowing what you have posted, start with a collection.

ClearCollect(
    colAuditQuestions,
    {
        Section: 1,
        Question: 1,
        QuestionText: "Question goes here",
        Answer: "NA"
    },
    {
        Section: 1,
        Question: 2,
        QuestionText: "Question goes here",
        Answer: "NA"
    },
    {
        Section: 1,
        Question: 3,
        QuestionText: "Question goes here",
        Answer: "NA"
    },
    ...,
    {
        Section: 1,
        Question: 10,
        QuestionText: "Question goes here",
        Answer: "NA"
    }
)

Then add a gallery to a page connected to this collection.
Add the appropriate controls to allow the users to answer the questions.
The radio control OnChange = Patch(colAuditQuestions,ThisItem,{Answer:Radio2.Selected.Value})
Then add some controls that show the stats you want for the summary as per below.
sample.JPG

Hope that helps get you started.

Cheers Hadyn

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (40,104)