Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Restrict filters and breadcrumbs with fixed queries

Juan Pablo Vas1
Tera Contributor

Hi Community,

I need to add an argument to a Module link type, so I can restrict my user to a specific set of records and he can't see all records by clicking all.

However, the filter is set using is (dynamic) Me

like this: Manager IS (dynamic) Me OR Assigned_team CONTAINS is (dynamic) Me

Query looks like this

case_managerDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORassigned_teamDYNAMIC90d1921e5f510100a9ad2572f2b477fe

I need a &sysparm_fixed_query= that matches this dynamic query but I'm not sure how.

Could somebody help me with this one?

Regards.

JP.

1 ACCEPTED SOLUTION

Is the following in the 'arguments' field on the module not working?

&sysparm_fixed_query=case_managerDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORassigned_teamDYNAMIC90d1921e5f510100a9ad2572f2b477fe

ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

View solution in original post

8 REPLIES 8

Try what Paul suggested. It's not user sys_id it's filter sysid so anyone clicking on that module link will get logged in user's sys_id. That should work fine.

&sysparm_fixed_query=case_managerDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORassigned_teamDYNAMIC90d1921e5f510100a9ad2572f2b477fe
 

Thanks, I'll give that a try, and comeback šŸ™‚

there is a dynamic list filter for 'dynamic (is me)' on user reference fields.

I thought you were already using that?


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Ok, work perfectly. what I did not understand from the start is that the query included the Sys_ID of the filter, and not the one from the user... now I understand that the query was ready to be used.

 

Thank you!