Is it possible to make field with type "Name Value pair" as multi choice?

Narayan K
Tera Expert

Hi there,

 

I have a field "Enterprise Application ID" with type "Name Value pair". Is it possible to make name part as dropdown? I tried to achieve it in my PDI but its not working. Is it feasible to achieve? if yes then how? If not, is there any way to customize this field?

NarayanK_0-1757676875765.png

 

Thanks!!

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Narayan K 

not possible.

It's OOTB behavior.

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

View solution in original post

7 REPLIES 7

RaghavSh
Kilo Patron

Name value pair is “type” of field.

you will not be able to add another “type” which is choice into the already existing field type.

 

If you want to restrict particular choices in name then you will have to do it  onSubmit(client) of form and see if name has other values than what you want and abort the action.

 

It can also be done on server side side using before insert BR.


Raghav
MVP 2023

@Narayan K Choice is not possible but you can do onSubmit / before insert validation as suggested.


Raghav
MVP 2023

M Iftikhar
Mega Sage

Hi @Narayan K ,

 

The Name-Value Pair field type in ServiceNow is a specialized composite field. Out of the box:

  • The Name part is just a free-text string.

  • The Value part can be string, integer, reference, etc. depending on how it’s configured.

  • It doesn’t support a dropdown list for the “Name” portion directly.

Is it feasible to make “Name” a dropdown?

Not directly with the stock Name-Value Pair field type. That field type is fixed in its rendering and doesn’t have dictionary options for making the “Name” part reference or choice-based.

 

Recommended Approach: Use two separate fields instead of Name-Value Pair

  • Create a Choice field (dropdown) for your “Name” options.

  • Create another field for “Value” (string, integer, reference, whatever you need).

  • Group them on the form (or use a UI Macro/UI Component to display them side by side if you want the same “pair” look).

This is maintainable, works with reporting, and avoids OOTB hacks.

 

Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.

Hi @Narayan K ,
If my response helped, please mark it as the accepted solution so others can benefit as well.


Thanks & Regards,
Muhammad Iftikhar