Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Looking up latest value of user input in a catalog item

MarinaN
Tera Expert

I need to generate a server name based on already existing server names. 

The method right now is: 

-user submits a request via the catalog item

-script include + client script generate a new name in the following manner:

-look at the server name in the cmdb and add 1 to the last 2 digits

 

The problem is: 

-the creation of a server is manual, so it can take time between user submission and the server appearing on the cmdb, so the server name generation could make duplicates 

 

Given that the servers requested are always created, how can I look at the latest RITM/variable value and add 1? 

would it be stored in sc_item_option_mtom?

4 REPLIES 4

Ankur Bawiskar
Tera Patron

@MarinaN 

variable value is stored in this table "sc_item_option_mtom". So you can check there
But still what if multiple users are trying to submit form at same time

You will face issue for duplicates.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

MarinaN
Tera Expert

But will it show the user input as a string? 

e.g. "Server1" ? 

 

I don't think there are that many requests, let alone simultaneously. 

@MarinaN 

then same approach you can stay with.

Simply query that mtom table with that question and grab the value rather than checking RITM table as it will be huge table

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

SwamyM
Tera Guru

Hi @MarinaN ,

 

You can define Number maintenance to Server table to generate new number while creating new Server. This will allow you manager number without any duplicates.  If defining number management not allowed to Server table. then you can create new custom table in CMDB to define number management. and call the number management of that custom table while you create new Server record in server table.

 

https://www.servicenow.com/docs/r/platform-administration/t_AutoNumberingRecordsInATable.html

 

Please click the “Accept Solution” or “Helpful” button, if my response helped you resolve the issue.

 

Thanks,

Swamy