Modify default query for Sn record picker

aksh3
Giga Guru

Hello Experts,

 

I want to modify the default query for the below script , i want to add the below mentioned conditions

Condition : if a user is active and name starts with

 

<sn-record-picker id="delegate" field="c.delegate" table="'sys_user'" default-query="'active=true'" display-field="'name'" display-fields="'email'" value-field="'sys_id'" search-fields="'name'" page-size="100" translate="no"></sn-record-picker>

 

 

Right now default query runs checks for if the user is active and 'name contains' instead of name contains i want to check for "name starts" with.

 

Please help.

2 REPLIES 2

Abhay Kumar1
Giga Sage

@aksh3 you can paste encoded query in default-query.

In your case, you can use default-query="'activate=true^nameSTARTWITHyour_text'".

Hope this will help you.

In the Server Side of the Widget:

 

data.encQuery = 'encoded query';

 

Then in SN Record Picker call the same as mentioned below:

 

<sn-record-picker

     field :

     table:

    default-query = 'c.data.encQuery'>

</ sn-record-picker>