How to set default value on a filter in UI Builder

Dotychczas
Mega Guru

Hello Everyone,

I am working on a problem in UI Builder where I need to set a default value for a filter on a page using 'sys_id'. I'm not sure about the right format for this data. I tried many ways, but none seem to work. Also, this information isn't in the documentation.

I don't want to hardcode the value because my use case is different. Also, when I try using an object, the filter count increases, but it just keeps loading and doesn't work. Can anyone help me with the correct format for the data?

Dotychczas_0-1704798966131.png

 

5 REPLIES 5

Community Alums
Not applicable

HI @Dotychczas ,

Where is the filter? can you share a screenshot here please and also this is part of which workspace?

 

Dotychczas
Mega Guru

 

It's on a custom page that we created. Here "Default value" script:

Dotychczas_0-1704805840551.png

I need return value in here and I don't know what the format should be? Is format of the data returned in script depends on where filter is being placed?

brandon5
Tera Contributor

We opened a hi ticket on this. they provided this format and it works

 

1. Using static default value:

return [{
available : true,
id : "dfsdf7sd6f7sdf6dsf",
label : "Option 1"
},
{
available : true,
id : "7657765fsdfsdfsdf567",
label : "Option 2"
}];

 

Monika2
Giga Guru

Did you find the solution for this? I have a similar requirement