Need to get the unique values for a reference field

Yesh
Tera Contributor

Hi Team,

My reference field is visible like this:

IM Argentina Operating Unit

IM Argentina Operating Unit

IM Argentina Operating Unit

IM Argentina Operating Unit

IM BR OU

IM BR OU

.............

But I need the unique Values.

How to achieve this requirement?

Thanks,

Yesh

1 ACCEPTED SOLUTION

Nikhil65
Mega Guru

Hi @yesh ,

Why don't you get all sysid into an array, then use unique of arrayUtil class.

Then you can populate the select box with the unique values of array.

Api | ArrayUtil - ServiceNow Developers

 

Hope this helps!

 

Thanks,

Nikhil

View solution in original post

11 REPLIES 11

Nikhil65
Mega Guru

Hi @yesh ,

Why don't you get all sysid into an array, then use unique of arrayUtil class.

Then you can populate the select box with the unique values of array.

Api | ArrayUtil - ServiceNow Developers

 

Hope this helps!

 

Thanks,

Nikhil

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Yesh,

Are there any unique field in the existing table? Which fields are unique in the table? If there isn't any field that is unique, create a new field that will be unique.