- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 12:57 AM - edited 11-17-2022 08:52 PM
I was unable to apply filter condition in Nxt Exp, even after selecting some filter, filter is not getting applied and also reports are not getting refreshed accordingly..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2022 08:19 PM - edited 11-14-2022 04:20 AM
Hi,
This is how you can get the reports to work for your filter component.
1. Create a client state parameter on your page. Here I am using "parFilters" of JSON type.
2. Create a client script and add below code.
//Set the filter
api.setState('parFilters', ({
currentValue
}) => {
const {
payload: {
appliedFilters
}
} = event;
return imports['global.mergePARFilters']()(currentValue, appliedFilters); //The visualization components are built to listen to filter events.
});
Add script include "mergePARFilters" to the client script.
3. Make sure your data visualization component is set to follow the filter.
4. Trigger your client script(created in step 2) from your filter component events.
That's it! 🙂
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 03:31 AM
@Anubhav Ritolia can you help me on my query..
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2022 08:19 PM - edited 11-14-2022 04:20 AM
Hi,
This is how you can get the reports to work for your filter component.
1. Create a client state parameter on your page. Here I am using "parFilters" of JSON type.
2. Create a client script and add below code.
//Set the filter
api.setState('parFilters', ({
currentValue
}) => {
const {
payload: {
appliedFilters
}
} = event;
return imports['global.mergePARFilters']()(currentValue, appliedFilters); //The visualization components are built to listen to filter events.
});
Add script include "mergePARFilters" to the client script.
3. Make sure your data visualization component is set to follow the filter.
4. Trigger your client script(created in step 2) from your filter component events.
That's it! 🙂
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 04:21 AM
I forgot to add step 4. Added in my response above. 🙂
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 12:17 AM
Its not working, Can you share if you have any other solution