How to hide the title of a variable set

M_Tomy
Tera Expert

Dear Experts.

 

I have a requirement to show or hide certain variables under certain conditions.
So I have used "g_form.setVisible" in the UI policy to hide the variables in the catalog task.
However, I am having trouble seeing the title of the variable set to which the hidden variable belongs.

I would like to hide the title of the variable set without using the SysID of the variable set if possible.
Please let me know if you have any insight.

 

▼Added on 10/29/2022
Added an image drawing.
Please refer to it as well.

 

Best regards.

 

 

9 REPLIES 9

Hi @M_Tomy,

 

I mean to say, when you hide the all variables inside the variable sets. It will hide the title as well.

 

Thanks,

Sagar Pagar

The world works with ServiceNow

Hi @Sagar Pagar ,

 

This is ok, but dynamically is it possible to hide only the Display Title (display_title) of a variable set?

For example, when all 5 variables of a set are visible, then its title will be shown.

But if only 1 variable of the set is visible, other 4 are hidden, then the display_title will also be false.

 

Is this possible to be achieved through client-side script?


Please mark this post as a solution and also as helpful, if this resolves your issue or query.

Thanks,
Subhadeep Ghosh.

Hi @subhadeep1618,

 

I believe it won't be possible. but you can try with DOM manipulation based on your conditions.

Hide the title of variable set on form load 

 

If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow

M_Tomy
Tera Expert

I then implemented the following and got the result I wanted.

 

 g_form.Display('variable name', false);

 

Thank you all for your help and advice.

subhadeep1618
Tera Guru

Dynamically through client side script, I have to set display_title of a variable set to false.

Requirement is: I want to show only 1 variable of a variable set, but I don't want to show its title in that case.

However, if all variables of the set are shown, then its title will be displayed as usual.


Please mark this post as a solution and also as helpful, if this resolves your issue or query.

Thanks,
Subhadeep Ghosh.