we have one single line Text variable in default value i am given 1but it's not displaying in portal

mani55
Tera Contributor

we have one single line Text variable in default value i am given 1but it's not displaying in portal

 

mani55_0-1689842667139.png

 

But above default value is not reflecting in Portal please check below screeshot. so please let me know what is the issue

 

mani55_1-1689842728560.png

 

2 REPLIES 2

Sagar Pagar
Tera Patron

Hi @mani55,

 

Make sure there is not Catalog UI policy or Catalog client scripts which override the default value and set as empty.

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar

The world works with ServiceNow

Pavankumar_1
Mega Patron

Hi @mani55 ,

That is expected it show default value only on backend not in portal

If you want to set value on portal use onload client script as below and UI type is ALL then you can remove default value client script will do that for both portal and backend.

function onLoad() {
	g_form.setValue('number_of_devices','1');//give your variable name then it will populate value
}

 

Screenshot (15).png

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar