Mike Kastens
Posts: 0
Joined: Sun Jul 26, 2015 7:27 pm

Navigate to new page when query fails

Hello -

I am searching my database for zip code entered by the user. The query works fine and I set the result to a storage variable. This is, however, when the zip code is contained in the database. If the user enters a zip code that is not contained in the database I would like to navigate to another page. What is the best way to do this?

All help is much appreciated,

Mike

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

Navigate to new page when query fails

Hello Mike,

Sure, it is possible. Please add a JS code below to the success event to navigate user to another page if there are no results:
preif (!data.length){
Apperyio.navigateTo("nextPage");
}/pre
here nextPage - name of the page, you need to navigate user, if there are no results

Return to “Issues”