Dynamic filter on list type returning (NULL)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2024 07:56 PM
Hi,
I'm trying to create a dynamic filter to show current user as squad member.
We have table Touchpoint -> field squad (type list) reference -> Squad member table (has field user that references to the sys_user).
The dynamic filter is returning (NULL) value. Please help.
List link - https://k8s0591134-node1.thunder.devsnc.com/now/cwf/agent/list/params/list-id/92f91a9fff2d02102f03ff...
Dynamic filter - https://k8s0591134-node1.thunder.devsnc.com/now/nav/ui/classic/params/target/sys_filter_option_dynam...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2024 08:40 PM
Hello @Pragati Ajanalk,
If you are not comparing anything in the script include at server side then why can't just use gs.getUserId() in reference qualifier.
You can also use OnLoad CS with GlideAJax to set squad member with current logged in user.
Thank You,
Rajesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2024 12:19 PM
Hi @Rajesh_Bhise
As squad is of type List, it is not possible to dot walk and use gs.getUserId().
squad (list) -> reference (squad member table) -> have a field (sys_user)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2024 06:35 AM
Hello @Pragati Ajanalk,
I tried to replicate the same scenario in my PDI as follows:
- Created custom table - Squad Member Tables
- Created two fields within it.
Squad member (type - reference, referenced it to user table)
Squad Check (type- true/false)
- I created one custom field "Squad" (type-list and referenced to Squad member table above) on Incident form and added logic to update logged in user in the Squad field value.
- Squad field is updating as below:
- Custom field on Incident table configured as below:
- Logic to updated logged in user is added as below:
I have tested this as admin and itil user as well.
Hope this fulfills your expectation. Happy to share idea on this and will do the same in future as well.
If this satisfies you, please mark my answer correct and helpful.
Thank You,
- Rajesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2024 08:55 AM
Hi @Rajesh_Bhise ,
Thank you for your response.
I'm not trying to assign a current logged in user to the squad field.
Squad can have multiple squad members. In sys_ux_list I want to add a filter, My touchpoints (My Incidents in your example) that shows all the touchpoints where squad list contains the current logged in user.
So, I'm trying to create a dynamic filter. Please refer the instance links I shared.
