Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Default Value of Compoment filter don't display when get data from data resource

nhann2
Tera Contributor

My requirement is that I want to set the default filter when the user load the page like the image below:

nhann2_4-1716876218232.png

When applying the code below in Filter default value script and get the id by using api.date like the image below, the default value is not displayed

nhann2_0-1716875685499.png

nhann2_2-1716876115384.png

 

But when I tried to hardcode the value id (example admin9999"),  it's working

nhann2_1-1716875931836.png

nhann2_5-1716876495869.png

 

What is the reason and is there any way to make it work ? 

Thanks

1 REPLY 1

Lhora Alvarez
Tera Sage

@nhann2 

Can you check the timing selected for your api.data.getuser function?

Data resources can be triggered immediately when page loads or after another data resource.