Is it possible to dynamically assign the default value of a filter in UI Builder?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 03:12 AM
Hi,
I am building a home page in UI builder with some reports that need to be filtered by location.
I am wondering if it's possible to dynamically assign this default value in the filter to be the same as the users locations.
I should be able to grab the current users location with a client script and update a client state parameter with the location. But I'm not sure how to get this value into the default value of the filter.
Any ideas would be great?
Thanks in advanced
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 03:54 AM - edited 02-24-2025 03:58 AM
Hi @scottl ,
Maybe a little late to the party here but thanks to your example I did get this to work as follows (I'm on a page with a form controller):
function evaluateProperty({
api,
helpers
}) {
return [{
"label": api.data.controller.displayValue,
"id": api.data.controller.sysId,
"value": api.data.controller.sysId,
}];
}