Bit of help needed

OK, I have a form which checks a postcode, if the postcode exists in the database then I need to to goto (page a) if the record does not exists then i need it to goto (page b)
In dreamweaver used to be done with if record exists, but can’t seem to work it out in wappler. Has anyone got any ideas?

Have a look at this Check if a Database Record Already Exists Before Inserting a New Entry and use the Browser widget to go to another page.

Hi Ben, its good that your in AUS as your awake. Have tried that and does no work.
scratching my head on this one, used to do it in dreamer weaver with ‘if no record returned’ and that worked fine but don’t have that option in wappler

@ben, ok figured it out. I had to do it with a record count and this now works :slight_smile:

1 Like

Sorry not getting back to you, had a rather long video meeting. Great that it’s all fixed.

You can do this

1 create query (with search parameters if you need)
2 add if condition and your expression will be like ( {{query1}} … this mean return true if query1 have items else return false

3 create responce inside 'else 'and ‘then’ (responce name will be same inside 'else 'and ‘then’)

You dont need count

Hello @ben
This is just validation so you cant go to page function with validation component

1 Like

There is a specific function to check if a query has records. It is called “Has Items”

1 Like