How to encode uri with javascript:gs.getUserID()

davilu
Mega Sage

Our team is using the widget-data-table and trying to test the export functionality with a filter that has javascript:gs.getUserID().  When we try to export to Excel, it returns a Forbidden page.  When we take away "javascript:" it works, but the exported list of records seems to ignore that part of the filter.  Is there a way to encode the uri when a filter has "javascript:gs.getUserID()" within it?

2 REPLIES 2

Mike_R
Kilo Patron
Kilo Patron

What if you try is (dynamic) me instead. Does that have the same issue?

Mike_R_0-1667502434840.png

 

davilu
Mega Sage

Hi Mike, thanks for the reply, our team is fairly confident that the reason this isn't working is due to a WAF issue.  We took a look at this article https://www.servicenow.com/community/developer-forum/how-to-encode-uri-with-javascript-amp-colon-gs-... and made the changes so that our query looks like subject_person!%3Djavascript%3Ags.getUserID().  When testing this in a personal dev instance, it works perfectly, but refuses to work in our development instance.