Dynamic filter on list type returning (NULL)

Pragati Ajanalk
ServiceNow Employee

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...




4 REPLIES 4

Rajesh_Bhise
Tera Guru

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

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)

Hello @Pragati Ajanalk,

 

I tried to replicate the same scenario in my PDI as follows:

           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:

Rajesh_Bhise_0-1717680674279.png

 

  • Custom field on Incident table configured as below:

 

Rajesh_Bhise_1-1717680727024.png

 

  • Logic to updated logged in user is added as below:

 

Rajesh_Bhise_2-1717680780094.png

 

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

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.