Button Mapping with Variables

Moderator: Support

bobby_123
Posts: 2
Joined: Fri Oct 09, 2020 7:10 pm

Button Mapping with Variables

Post 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...

Serhii Kulibaba
Posts: 147
Joined: Tue Aug 27, 2013 1:47 pm

Re: Button Mapping with Variables

Post 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

bobby_123
Posts: 2
Joined: Fri Oct 09, 2020 7:10 pm

Re: Button Mapping with Variables

Post 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.

Post Reply