How to script the filter component in the UI BUilder

Vadzim Surin1
Tera Expert

Hello everyone.
I'm asking your help how to script the 'Filter source' property in the filter component in the UI BUilder.
I created one state parameter with JSON type and tried to script the 'Filter source' property. Then I bound this state parameter to the 'Filter source' property of the filter component. But I didn't get desired result. Filter doesn't show result according to the encoded query.
2024-05-28_11h33_39.png2024-05-28_11h33_21.png

6 REPLIES 6

Fernando Diaz
Tera Contributor

Hi @Vadzim Surin1 did you managed to add a script to a filter? Thanks.

AlexTimis
Tera Contributor

Hi guys,

In case anyone wants to also return a specific field back and not the default one which is always Title.

By simply specifying the field name in the JSON worked for me, here is an example:

{
"encodedQuery": "is_reservable=true",
"payload": {
"primaryKey": "sys_id",
"table": "sn_wsd_core_space",
"field": "name"
},
"type": "table"
}

Good luck!