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.

Default value as NONE for Catalog Item Variable

Gayathri5
Tera Guru

Hi Experts,

 

I have Multi Row Variable set which has one variable as 'group' which is referencing to sys_user_group table, now i want to display  "None " as default value. I have a created a None as record in sys_user_group table, can u suggest is this the best approach or through any approach we can achieve this?

Creating a record is not good idea i think because when we promote this change prod, we can't go and create None as record in prod, so please do suggest can we achieve this via Catalog Client Script?

 

Regards,

G

 

2 REPLIES 2

AnirudhKumar
Mega Sage

Hello Gayathri,

You are right, it's not a good idea to create a record named None in the group table.

In such scenarios, it always helps if you put a question to the client to understand what is the business case to have None selected in a group field. Are they trying to enforce a selection from the users? If that is the case you can simply make the field mandatory

My opinion is you are better off leaving the field empty - it is as good as None.

Barrilito van D
Kilo Guru

Default behaviour for a reference field is that it stays empty until you choose a record. And when you have chosen a record you can delete it to become empty again. As AnirudhKumar describes, play with the mandatory option if it is mandatory and always guide your users with explanatory text if something specific is needed.