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 embedded list with UI Policy

JJG
Kilo Guru

Hello,

I have a checkbox field, when it is selected I would like the embedded list underneath to be hidden. How can I do this?

Here is what I have so far in my UI Policy:

Condition: when checkbox is true

Script:

g_form.hideRelatedList('SF Involvement in Non - Criminal Court Actions 28');

Here is a picture of the form:

find_real_file.png

18 REPLIES 18

rahulpandey
Kilo Sage

Hi,

I have created a function for this case. Below is the code

Note: on UI script, there is a field called Isolate script, uncheck it.

manipulateEmbeddedList("Incident Tasks", ""); // @first parm title of embeded list @second would consider "none"/""
function manipulateEmbeddedList(title, behavior){
document.querySelectorAll('[tab_caption="'+title+'"]')[0].style.display = behavior;
}

result

Visible

find_real_file.png

Hidden

find_real_file.png

@JJG  can you check above solution ?

Yes i tried and it did not work

Can you try to add alert, please check my last response , i have added some steps to troubleshoot it.