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 variables from Portal

Cat
Mega Guru

Hi all,

 

I'm trying to do something that seems simple, but for the life of me, I can't get it to work.

 

I have a couple of variables that I have only visible in the Catalog Task and it is hidden in the Request item and Portal.

When the variable is filled in in the sctask, it doesn't appear in the request item. However, it appears on the portal. I'm using a Catalog UI policy to make it only visible in the sctask. I also created a Catalog Client Script to hide the variable on the portal using a g_form.SetVisible false

 

I feel like I've done everything I can, but as soon as the variable is filled in, it shows up on the portal!

 

Does anyone have any ideas of what I am missing?

 

Thanks for any help!

8 REPLIES 8

@Cat 

where on portal? which page?

share screenshots for better help

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

It's in the portal when the client views the ticket they submitted: 

Cat_0-1763384803543.png

 

@Cat 

catalog UI policies or catalog client scripts don't work on the ticket page.

So showing/hiding based on some condition doesn't work there.

If you want to hide some variables then you can uncheck this "Visible on Summaries"

AnkurBawiskar_0-1763387220122.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Sarthak Kashyap
Kilo Sage

Hi @Cat ,

 

Can you please check the client script if any client script work on UI Type is desktop and doing setVisible("field1", false); or setDisplay("field_1", false);

 

Or working on UI Type portal and doing 

setVisible("field1", true); or setDisplay("field_1", true);

 

Sample Screen Shot

SarthakKashyap_0-1763382798863.png

 

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards,

Sarthak