Get the Sys_id of choice List Values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 04:09 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 04:22 AM
where would you like to get that record sysId and why?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 04:29 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 08:24 PM
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?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 11:18 PM
Hi @Ankur Bawiskar ,
Below is the requirement.
Catalog Item Variables:
1. Groups
2. Modules: Aa and Bb (only 2 choices)
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)
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