Get the Sys_id of choice List Values

Rakshanda Kunte
Tera Contributor

Hi All,

 

Can we get the Sys_id of Choice Values?

 

i.e. we have state field on Incident form and, have choice = "Open", so can we get the sys id of this "open" record?

Sys_id of Open record is : 91464cb521120110a866589604c20d9a

 

RakshandaKunte_0-1683025758507.png

 

 

 

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@Rakshanda Kunte 

where would you like to get that record sysId and why?

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

Hi @Ankur Bawiskar ,

I am printing that sys_id on a form just for checking as trying one use case and checking what values that field is taking.

I know, this can be done using getValue, but need to check with sys_id so that I can develop further validations.

@Rakshanda Kunte 

I would love to understand the business requirement to get the sys_id of that record.

On what form what script are you writing and what validations are to be done?

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

Hi @Ankur Bawiskar ,

 

Below is the requirement.

 

Catalog Item Variables: 

1. Groups 

RakshandaKunte_0-1683094564500.png

 

 

2. Modules: Aa and Bb (only 2 choices)

RakshandaKunte_1-1683094564448.png

 

 

This is creating a record on Table: (Table Name = Demo)

 

Field on a Table:

1. Module (Reference) 

 

Condition: Once 'Aa' is selected on a catalog form, it will map to Module field on a table with "Post 1" value. 

if "Bb" selected on catalog form, it will map "Post 2" value on table. (This is done using flow designer)

 

RakshandaKunte_2-1683094564480.png

 

 

 

Requirement: 

 

If there are existing records on table with group name = ABC and Modules = Aa and Bb, then it should not allow to create another record.

i.e., if there are already records created as below then it should give error msg.

 

If there Record is created with only 1 Module (i.e. Aa) then it will allow to create another one with module Bb.

 

E.g., 

1st Record

Catalog Form Variable:

- Group = ABC

- Module = Aa 

Record created on a table with below field:

- Module = Post1 

 

2nd Record

Catalog Form Variable:

- Group = ABC

- Module = Bb 

Record created on a table with below field:

- Module = Post2