- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2024 01:26 PM
In the Platform Analytics Academy - Crafting Insights with UI Builder, they have used a specific script to bind the the Filters with the other elements.
YouTube video - https://www.youtube.com/watch?v=rK7JuNJrLEw&list=PLkGSnjw5y2U6HotK0MQUbCrzVog_zBWat&index=11
A small part of it is not visible and I was unable to make out what it could be. Can any of you please share it if possible.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 05:31 AM
I think this is the script you are referring to:
function handler({ api, event, helpers, imports }) {
const mergePARFiltersV2 = imports["global.mergePARFilters"]().v2;
const { appliedFilters } = event.payload;
api.setState("parFilters", ({ currentValue, api }) => {
const { parFilters, encodedQueries } = mergePARFiltersV2(
currentValue,
appliedFilters
);
api.setState("encodedQueries", encodedQueries);
return parFilters;
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 05:31 AM
I think this is the script you are referring to:
function handler({ api, event, helpers, imports }) {
const mergePARFiltersV2 = imports["global.mergePARFilters"]().v2;
const { appliedFilters } = event.payload;
api.setState("parFilters", ({ currentValue, api }) => {
const { parFilters, encodedQueries } = mergePARFiltersV2(
currentValue,
appliedFilters
);
api.setState("encodedQueries", encodedQueries);
return parFilters;
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 09:18 AM
Yes absolutely, thanks for sharing!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 09:48 AM - edited ‎11-06-2024 09:49 AM
Also, this is in the Component reference on the dev site. This reference is the go-to for configuring any UIB component. https://developer.servicenow.com/dev.do#!/reference/next-experience/xanadu/shared-components/sn-comp... (You have to scroll down as the internal page links don't work.)