Page 1 of 1

Button Mapping with Variables

Posted: Fri Oct 09, 2020 7:13 pm
by bobby_123

Hi All,

I'm a bit stumped on how to map a button to different pages, depending on a label's text.
The labels text is being pulled from a collection in my database.

I would like to route the button to "x" page if labels text = "y" and to "a" page if labels text = "b".

Could anyone help out with this? I'm a bit lost and quite a noob...


Re: Button Mapping with Variables

Posted: Sat Oct 10, 2020 5:10 pm
by Serhii Kulibaba

Hello Bobby,

It is not good to use text from the label for that, much better to save it to the Storage variable, but still.. Here is the code you need:

Code: Select all

if (Apperyio("myLabel").text() === "b"){
   Apperyio.navigateTo("x");
} else {
   Apperyio.navigateTo("y");
}

myLabel - the name of the label you check


Re: Button Mapping with Variables

Posted: Tue Oct 13, 2020 2:08 am
by bobby_123

Hi Serhii,

Thank you for the very insightful response!
I am still having an issue with the "Apperyio" calling though. I am getting an error when trying to use it saying "Cannot find name "Apperyio"". Any idea why it's not letting me use this?

I apologize again, I am very very new, and not familiar with Java/TypeScript.