web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do I make a tally
Power Apps
Answered

How do I make a tally

(0) ShareShare
ReportReport
Posted on by 3
I'm trying to make a test in powerapps by connecting it to a table in excel. The table would include thress columns, questions, answers and score. Everytime a user inputs the correct value in the text box which equals the corresponding answer tab the score value would be set from "0" to "1". I would then sum all of these values up and show it at the end of the test. How could I implement this in powerapps or is there an easier way to do so?
Categories:
  • datamaster Profile Picture
    250 on at

    What you can do is load your data to a collection and then update the record in the collection with the score of 0 or 1. You then do a CountRows(collection,filter(collection,sore=1)) to get your count of correct answers. I wrote a post on how-to-create-a-checklist-in-PowerApps that utilizes this approach. Hope this helps!

     

    ------------------------------------------------------------------------------OfficePowerUser.com------------------------------------------------------------------------ 
    If this post helps answer your question, please click on “Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up. 

  • Tunn Profile Picture
    3 on at

    Im still having trouble checking if the individual text inputs equal to the individual answers corresponding each question to any tips on how i could go about it? 

  • datamaster Profile Picture
    250 on at

    You can try something like this to compare the answer to the question. You can put this in an onChange event of the text input. control.

    If(Lower(ThisItem.Answer)=Lower(ThisItem.Question),updaeif(collection,ID=Thisitem.ID,{Score: 1}),updaeif(collection,ID=Thisitem.ID,{Score: 0})) 

    Then you use the method I explained previously.

     

    ------------------------------------------------------------------------------OfficePowerUser.com------------------------------------------------------------------------
    If this post helps answer your question, please click on
    “Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Tunn ,

    Could you please share a screenshot about your app's configuration?

    How do you list your questions from your Excel table? Using Gallery control?

    Do you want to sum all score values within your app after the user answered all questions?

     

    Based on the needs that you mentioned, I think you need to set up a collection as a data source within your app to collect user's answers. I assume that you added a Gallery control within your app to list all available Questions from your Excel table, is it true?

     

    I have made a test on my side, please consider take a try with the following workaround:

    Add a Gallery control in your app, set the Items property to following:

    'YourExcelTable'

    Within the Gallery, add a Label (Label1) to display question, and a Text Box (TextInput1) to collect user's entry. Set the Text property of the Label to following:

    ThisItem.Questions

     

    Outside the Gallery, add a Label to display the final score value. Set the Text property of the Label to following:

    "Final Score Value is: " & Sum(
     ForAll(
     Gallery1.AllItems,
     If(
     !IsBlank(LookUp('Your Excel Table', Questions = Lbael1.Text && Answers = TextInput1.Text)),
     1,
     0
     )
     ),
     Value
    )

    Please consider take a try with above solution, then check if the issue is solved.

    Note: The Questions, Answers represents the column from your Excel table.

     

    In addition, I also agree with @datamaster 's thought. You could also consider save your Excel table records into a Collection, then modify your Collection data based on user's entry.

    Set the OnStart property of the App to following:

    ClearCollect(LocalTable, 'Your Excel Table')

    Add a Gallery control, set the Items property to following:

    LocalTable

    add Label control and a Text Box as above to display question and collect user's entry. Outside the Gallery, add a "Calculate" button, set the OnSelect property to following:

    ForAll(
     Gallery1.AllItems,
     If(
     !IsBlank(LookUp(LocalTable, Questions = Label1.Text && Answers = TextInput1.Text)),
     Patch(
     LocalTable,
     LookUp(LocalTable, Questions = Label1.Text && Answers = TextInput1.Text),
     {
     Score: 1
     }
     )
     )
    )

    Add a Label to display the final score value, set the Text property of the Label to following:

    "Final Score Value is: " & Sum(LocalTable, Score)

    when the user complete the questions, and press the "Calculate" button, the final score would be displayed.

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard