Change Text on Next Page With App Variable?

Hi,

I’m currently looking through AppGyver videos for information on how to set an App Variable on something like a Dropdown Field’s Option List value (and a Checkbox Field), and then have it update text on the very next page.

So on the next page, if I have text that reads “Incorrect”, I need to change it to “Correct” if the selected item in the dropdown (or Checkbox) is bound to the App Variable.

Has anyone come across such a video? Or maybe knows of a better way to update text on next page based on component selection on previous page?

Thanks so much!

Hi, just checking in to see if this is at all possible on AppGyver at this time, or whether there is a workaround that anyone know of?

Thanks

I believe you should be able to achieve this with both app variables and/or page parameters.
Let’s say you start with a text type app variable “answer” then on the first page you would set the value of this variable to whatever the user chooses as an answer. Then you have also the correct answer stored somewhere, like in an app variable called “correctAnswer”.

On the second page you can bind the paragraph text to a formula like this:
IF(appVars.answer == appVars.correctAnswer, "correct", "incorrect")

Maybe this solution works for you?

You can also specifically send data between pages, this is done with page parameters, which are described here:

https://docs.appgyver.com/appgyver-academy/quick-onboarding-videos/part-3-variables#page-parameters

however in your case the app variable approach seems the better way in my opinion :slight_smile:

Hi @Akseli_Virtanen,

Thank you so much for taking the time to reply, I am truly grateful!

Based on your examples, I created two new app variables, of type “Any Text” (answer & correctAnswer). I tried type “Text” initially, but that didn’t work. And since the Dropdown Field seemed to use “Any Text” for its static text, I redid the app variables to match. Still does not work. :frowning:

For the first app variable “answer” I added 2 example values (Correct & Incorrect). On the first page (Airhead Quiz), for each answer option available to the user, I assigned either a value of Incorrect or Correct (only one answer option was assigned Correct for each question).

And again, because I wanted to test your ideas without changing anything, on the second page (Quiz Results), and for the first two answers, I used the exact formula in your example on the paragraph text components. When I test the app using the AppGyver app (runtime version 1.9.22), if I tap the SUBMIT button from the first page without selecting any answers, the first two answers on the second page show as Correct. So the Quiz Results page is showing Correct for the top two answers, whether or not I select an answer on the previous page, and if I select the wrong answers.

Nothing I have tried has worked. Because I have been at this for many, many days now, and having tried and retried so many different solutions on these same 2 pages, could the underlying code have gotten corrupted somehow?

Would it be possible for someone from AppGyver to take a look? The app number is 131300.

Thanks again for your time and suggestions.

Hi,

Unless I am mistaken, this should be a pretty simple little feature, yet no one seems to be able to share a working solution. Is it possible an AppGyver update has broken this capability? Or maybe the underlying code for those pages is corrupt? Or maybe I broke something? :worried:

I tried another simple solution on this post, and again, nothing works.

I have been trying to get this to work for 2 weeks now. Is there a paid support channel where someone could take a look at my app (#131300)?

Thank you!

Hi @Akseli_Virtanen,

I’ve tried this again in a separate app test build (app ID: 178038), and this formula:
IF(appVars.answer == appVars.correctAnswer, "correct", "incorrect")

seems to only have 1 possible result: “incorrect”

Which holds true in my tests. No matter which selection I make on the first page, the answer on the second page is always “incorrect”.

Regarding the button on the first page that a user would tap on to see their results on the second page, am I supposed to add some sort of logic flow here? I mean there is an “Open Page” logic piece, but nothing else. Is some other logic required here?

Really hoping there is a solution somewhere. :pray:

Thank you for your time and consideration!

Hi there, and sorry for the delay with the reply!

I quickly tested my proposed idea again and it does work as expected, so I think there’s just a a little communication issue here :slight_smile:

Here’s a very basic solution to this step-by-step:

  1. create 2 pages “quiz page” and “results page”

  2. create and app variable called “quizAnswer” and another called “correctAnswer”. For the correctAnswer let’s give an initial value “banana”.

  3. On the quiz page create a dropdown and enter some options, make sure one of the option values is “banana”. Bind the dropdown value property to “quizAnswer”

  4. On results page create a paragaph and bind it to a formula:
    IF(appVars.quizAnswer == appVars.correctAnswer, “correct”, “incorrect”)

Now you should be able to move between the pages and see that the text displays “correct” whenever you select “banana” from the dropdown. In any case where quizAnswer and correctAnswer don’t match the result will be “incorrect”.

Having confirmed this works, you can add more logic like the open page flow function etc.

Let me know how this works for you!

1 Like

Hi @Akseli_Virtanen,

Awesome! Now I can see a light at the end of the tunnel!

  • So for one, I totally missed that one app variable (answer) can act as the “off” switch, while the other (correctAnswer) can be the “on” switch, by utilizing their Initial values.
  • Two, I was previously binding the values in each dropdown option list item to the “answer” variable, which created all kinds of weirdness. Now I have removed the list item bindings, and instead set each list item value to match their labels, with the correct answer list item value being set to Banana.
  • Three, the above fixes didn’t immediately solve the puzzle, because there were no bindings yet. That’s when I realized that “Bind the dropdown value property to "quizAnswer"” most likely means to bind my “answer” variable to the “Selected value” of the Dropdown Field". When I did that for the first dropdown, everything worked.
  • Four, the above solution only worked as long as I bound only 1 dropdown field to the “answer” variable, but I have 5 dropdowns. So I converted the “answer” variable to an object, and added 5 properties “answer1 through answer5”, then assigned each property to a corresponding dropdown field.
    Then I adjusted the formulas on the results page for each of those bindings. Now all 5 of the dropdowns work perfectly - showing either correct or incorrect on the results page!!! :joy:
  • Five, The above solution only seems to work for Dropdowns. My last question must be checkboxes, because of this bug in the dropdown Option List: Dropdown Field - Option List Text Doesn’t Wrap
    I wonder if I need a true/false solution for checkboxes?

Anyway, I am very grateful for your time and expertise!