Query script not run in suggest box

194 Views Asked by At

In AppMaker, one my datasources has a simple query script associated with, because I need a filter everytime the datasource is requested. I'm talking about a normal SQL based datasource (not calculated).

Is it normal than this query script is not used when the datasource is used in a Suggest box ? Because it breaks my app (the user is able via the suggest box to select items he's not even supposed to see).

Thanks for your help

1

There are 1 best solutions below

2
Andrey Koltsov On

The options for a suggest field text box can either be provided explicitly, by binding to the options property, or by specifying a database query on a model using a startsWith filter on a field. You can set the model and field for the latter option below.

So you can try to create calculated model with server script starts with

var name = query.filters.name.startsWith;

name is field of model