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.

Why are client scripts not working in mobile agent?

Brianlion
Giga Contributor

I have a client script to hide a choice value for a list field depending on the assignment group of a user. The script works fine on desktop but won't work for mobile agent (not classic mobile). I selected "All" for the UI type in the client script configuration and still no luck. I read that client scripts may not work for mobile agent, but I am not sure. If they do not work for agent, is there another way I can achieve this functionality? Client script code posted below:

function onLoad() {
//Type appropriate comment here, and begin script below
var assignmentGroup = g_form.getValue('graffiti_assignment_group');
if(assignmentGroup == '8b18132bdbec0050eb4700b5ca9619b4'){
// Do nothing
}
else{
// Remove RAB option
g_form.removeOption('resolution_code', 'RAB');
}
}

5 REPLIES 5

That's cool and I don't really disagree with the concept in general, but entirely limiting that ability seems like a weird move.  Even super short forms might require some sort of logic.