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.

Hide UI Action based on metric type

matthew_hughes
Kilo Sage

There is a UI Action button called 'Take assessment' that appears on my form:

matthew_hughes_0-1714563346343.png

I'm wanting to hide it depending on the Metric type. I've written the following condition for my UI Action, but I can't get it to hide:

 

current.metric_type.active && current.user == gs.getUserID() && (current.state == "ready" || current.state == "wip") && current.metric_type.evaluation_method != "vdr_risk_asmt" && (current.metric_type!= gs.getProperty('AMATechnical') && current.metric_type!= gs.getProperty('AMABusiness') && current.metric_type!= gs.getProperty('AMAScoping'))

 

If somebody could let me know why my code isn't working and what I need to do to hide the UI Action based on the metric type, that would be much appreciated

2 REPLIES 2

Mark Manders
Mega Patron

Metric Type is a reference field. I don't know what you have in your system properties, but if you have the sys_id's there, it may help to check on current.metric_type.sys_id!=....


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

I tried that as well, but it the UI Action button on the form still appears, but it prevents the user from completing an assessment based on the assessment type.