cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Quiz Questions - Issues, formula/code not working - Seeking advice

Hi,

Hoping someone might be able to advise on this. This is the second post I have made, for some reason the original is missing. 

 

So I am currently creating a quiz in PowerApps. It looks like only three of the questions are working, and the final two are not. If it helps I was using the Shane Young YouTube video. 

 

So the three questions that are working are these below:

If(Q1.Selected.Value = "3",Set(Score, 1),Set (Score,0));

And(Q2.Selected.Value = "950mm",Set(Score,Score+1));

And(Q3.Selected.Value = "225mm",Set(Score,Score+1));

 

Then when I move onto the next page/screen, thats when it seems to stop, and the score no longer adds up:

And(Q2_1.Selected.Value = "Crane banked off site",Set(Score,Score+1));

And(Q1_1.Selected.Value = "19-24 mph 8.5-10.5 m/s",Set(Score,Score+1));

 

Is it because I have to many 'And' statements or is it because I am working across two pages/screens. I cannot seem to  think of any other issues, as the code has been copied from the first three questions, but changed slightly depending on the answers - What the code is supposed to do, is add up the score and then display a total at the end on the lower right of the screen. As mentioned it works perfectly on the first three questions and then doesn't on the final two. 

I have added two screenshot to explain the issue better.

Hope someone can make sense of it. Thanks. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Quiz Questions - Issues, formula/code not working - Seeking advice

Hi @RKnighton88 ,

 

Global variables are available throughout your app on all screens. So Global variables set in before screens should be able to work on later screens. 

 

What are the values that you want to add totally?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Quiz Questions - Issues, formula/code not working - Seeking advice

Hi @RKnighton88 ,

 

Global variables are available throughout your app on all screens. So Global variables set in before screens should be able to work on later screens. 

 

What are the values that you want to add totally?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,410)