I'm trying to do something unusual and creative, but running into errors. Hoping somebody can help me identify a solution.
I essentially have a quiz, and I want PowerApps to create a log of the answers so that I can mark them as correct or not correct (and the correct answer) in a gallery at the end of the quiz.
I used a ClearCollect and a FirstN(Shuffle to choose 10 questions at random from my SharePoint list and put them into a collection. That works great.
ClearCollect(PatientRecords, FirstN(Shuffle('MCI Game: Patient Information'),10))
One of the variables in the collection includes the correct answer, and the answer buttons are set up to add to the VarScore if the button they select matches the correct answer. Also works great.
If(Index(PatientRecords,VarStep).'Best Answer'.Value in "Green",
Set(VarScore, VarScore+5);Set(VarCorrect, VarCorrect+1),false);
Set(VarStep,VarStep+1); If(VarStep = 11, Navigate('Results Screen'),false)
Now, I'm trying to either temporarily write what answer they selected into a column of the collection, so that I can later compare the correct and selected answers to indicate if they got that particular question write OR
Create a new collection and put just the important few variables into it (Question Name, Correct Answer, Selected Answer) so I can display those on the results screen.
I've tried using PATCH, but LOOKUP cannot seem to find that particular line of the collection, because I can't use any particular variable, such as ID number because it's randomized each time.
I tried creating a new collection and adding those few items to it, but it again can't seem to gather the correct row from the randomized collection that allows me to put it into a new collection.
Patch(PatientRecords,Lookup(PatientRecords, VarStep,{ 'Choosen Anwser': "Green"})
Any suggestions?