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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to check the store...
Power Apps
Answered

How to check the stored value in collection in string value

(0) ShareShare
ReportReport
Posted on by 74
Hi, 
 
I am creating a quiz application in Powerapps. 
 
In my submit code. 
 
ForAll(
    GCGIntranetQuizGal.AllItems,
    Collect(
        colRadio,
        {
            Radio: ThisRecord.Radio4.Selected.Value,
            Question: ThisRecord.QuestionNumber
        }
    )
)
 
I will get the selected value of Radio then I will check if the stored value of is equal to the answers. 
 
Sample: 
 
This is my stored value in collection called colRadio
Then I will compared the Radio column to text "DMS", "DMS", "APPLICATIONS". 
 
Is it possible ? 
 
Thank you
I have the same question (0)
  • Suggested answer
    scalca Profile Picture
    243 Moderator on at
    you need to have somewhere the correct results and then compare it to what has been selected
     
    for example
    ClearCollect(colResult, ForAll(colQuestionResults, {question: ThisRecord.Question, result: If(answer= LookUp(colRadio, Question=ThisRecord.Question).Radio, "correct", "wrong")}))
  • Verified answer
    CU17091722-0 Profile Picture
    21 on at
    Hello,

    To compare the user's selected answers to the correct ones, you would need to have another collection or data source that contains the correct answers for each question. For example, you could have a collection colCorrectAnswers that

    ClearCollect(
        colCorrectAnswers,
        { Question: 1, CorrectAnswer: "Option1" },
        { Question: 2, CorrectAnswer: "Option3" },
        { Question: 3, CorrectAnswer: "Option2" }
    )

    And after y
    ou can then use a ForAll loop LookUp function
     
    ClearCollect(colResults,
        ForAll(
            colRadio,
            {
                Question: Question,
                UserAnswer: Radio,
                CorrectAnswer: LookUp(colCorrectAnswers, Question = ThisRecord.Question).CorrectAnswer,
                IsCorrect: If(Radio = LookUp(colCorrectAnswers, Question = ThisRecord.Question).CorrectAnswer, true, false)
            }
        )
    )

     
  • daywalker_567 Profile Picture
    74 on at
    Hi, 
     
    May I request also on how to make the scoring in this quiz application ? 
     
    Thank you

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard