cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rmbreb
New Member

How do I update and replace the score when users change their answer?

How do I replace a previously selected variable when the user goes back and changes their answer?

 

This app is like a quiz where the user goes through several questions, with each question featuring different options of different score values (e.g. if they select option A, it adds 0 to the score, option B will add 3 to the score, etc):

 

If(Radio1.SelectedText.OptionText = LookUp(Options,OptionId="1.1",OptionText), Set(Score,LookUp(Options,OptionId="1.1",OptionScore)));

If(Radio1.SelectedText.OptionText = LookUp(Options,OptionId="1.2",OptionText), Set(Score,LookUp(Options,OptionId="1.2",OptionScore)));

 

At the end, it calculates the final score to be out of 5: Round(((Score/110)*5),1)

 

The issue is, if the user goes back to a previous question and changes the selected option, the final score seems to add this on top rather than replace the previous answer, so the user ends up getting a final score like 6/5, 7/5.

 

How do I update and replace the score when users change their answer for some questions?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
lcimon
Resolver I
Resolver I

Hello @rmbreb,

 

To have this behavior, you need to save the score for each question separatly (in a collection or multiple variables) and calculate the final score at the end.

View solution in original post

1 REPLY 1
lcimon
Resolver I
Resolver I

Hello @rmbreb,

 

To have this behavior, you need to save the score for each question separatly (in a collection or multiple variables) and calculate the final score at the end.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,325)