How to apply 'default-query' for Reference Field in Service Portal widget

rpoola
Tera Contributor

Hi,

I am working custom widget. Can anybody tell how to apply 'default-query' for Reference Field in HR portal.

For reference field i am using following

<sn-record-picker field="placement" id="placement" table="'xxxxx'" display-field="'u_title'" value-field="'sys_id'"   default-query=""   search-fields="'u_title'" page-size="10" ></sn-record-picker>

I have tried in different ways but i am not understanding how to apply default-query to the reference field. Now i am populating all records but I want to query with some restrictions.

find_real_file.png

nathanfirth

ctomasi

5 REPLIES 5

anurag92
Kilo Sage

I tried using it as:



default-query="'name=Java Developer'"




and this worked. observe that this are single inverted commas after double.



Let me know if this helps and mark helpful/correct accordingly.


nathanfirth
Tera Guru

It's just an encoded query. Go to the list view of that table and generate your query using filters, then right click on the filters and select "Copy query" and paste that in the directive.


Thank you Anurag and Nathan for response.



Nathan,


As u suggested I have taken encoded query from list view and it is working fine.


Thank you


I am trying to use the query "active=true^NQactive=false^nameSTARTSWITHA". However ^NQ is not working. Can you please provide an alternative to the above query.