Populate 'None' in a mandatory reference field if no records and allow user to submit the form

Ankita9793
Tera Contributor

Hi All,

 

I have a mandatory reference field called 'Select Device' if there are no device records available, then None should be displayed, and user should be able to submit the form. 
Please suggest, TIA

Ankita9793_0-1747813677219.png

 

3 REPLIES 3

J Siva
Tera Sage

Hi @Ankita9793 
I don't think it's possible to submit the form by selecting OOB 'None' option on the mandatory field.
As a workaround, create one record on the reference table like below and ask the end users to use that. Also update your reference qualifier to include the "  --None--" value.

JSiva_0-1747817302869.png

Regards,
Siva



Ankur Bawiskar
Tera Patron
Tera Patron

@Ankita9793 

That's not possible with reference field.

I won't suggest any other workaround as it would be a technical debt to have and store dummy record in that table just to achieve your requirement.

Don't make that field mandatory and allow user to submit with empty Device.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

bhaveshbawa
Tera Contributor

Make your field non mandatory initially. 

Then you can Create Onload Client Script and call Glide Ajax to check weather the record is available or not. 

Basis on the answer from Script Include you can simply make it mandatory if record available else non mandatory.

 

The current Advance Reference qualifier will be same you will just have Client Script and Script include to make mandatory or not.