sysparm_fixed_query is not working in UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2025 01:57 AM - edited ‎07-31-2025 01:58 AM
I have created the following UI Action:
var fUtil = new FacturacioUtils();
var tasquesFacturades = fUtil.tasquesFacturades(current.projecte.toString());
var query = 'top_task=' + current.projecte + '^sys_idNOT%20IN' + tasquesFacturades.join(',');
var url = gs.getProperty('glide.servlet.uri') + `sys_m2m_template.do
?sysparm_fixed_query=` + query + `
&sysparm_m2m_ref=x_tntsl_tmn_factur_facturacio_m2m
&sysparm_collectionID=` + current.sys_id + `
&sysparm_collection=x_tntsl_tmn_factur_factures
&sysparm_collection_key=x_tntsl_tmn_factur_factures
&sysparm_collection_related_file=planned_task
&sysparm_collection_related_field=planned_task
&sysparm_stack=no `;
action.setRedirectURL(url);
Nonetheless, when I launch this UI Action the filter does not apply. I am sure query is generating right because if I change "sysparm_fixed_query" by "sysparm_query" it works fine, and I cannot create a before query BR because the tables I am using are in scope application. Does anybody know why "sysparm_fixed_query" is not working? Do you know how to fix it?
Thanks in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2025 02:45 AM
Hello @jordimsant
As a workaround you an try using client script in UI action to redirect user to specific URL. The script include you can call from client script using GlideAjax (of course client callable script include).
Thank you,
ALi
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2025 02:48 AM
I think I am not understanding. The matter is that if I change "sysparm_fixed_query" by "sysparm_query" it automatically works, and the other way around. If I just redirect to the same URL, I suppose it won't work neither.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2025 03:07 AM
I tried static link with fixed query in server script of UI action redirect and it did not work, but same link worked when I used client side script for UI action and location.href = URL;
Thanks,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2025 03:11 AM
Hi @jordimsant ,
you can create a Query BR instead
you can refer this
Solved: Using sysparm_fixed_query in URL - ServiceNow Community
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya