MultiRow Variable Set Incremented Number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2019 01:41 PM
I am writing a record producer to submit change requests and to add the deployment instructions on a separate table, I added a multi-row variable set to collect the deployment instruction information and submit it separately.
Deployment instructions have an order field and the problem I am running into is I haven't found a way to autoincrement this order field when adding to the multi row variable set.
I was trying to set the default value to the nextObjNumber() function and that's what I get. If I try to add another row, it produces the same value. I was trying to script it using JSON.parse to check the variable set client side but you cannot setValue using an onLoad client script. Has anyone else ran into this problem and found a solution? I think this is a common use case for multi row variable sets. This article is similar, but I don't need to grab existing gliderecord data.
https://community.servicenow.com/community?id=community_question&sys_id=145bd604dba1bf40e0e80b55ca961906

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2019 11:23 PM
Hi,
Basically, the nextObjNumberPadded() basically works in table fields not on variables, and record numbers are automatically incremented, and the next number is maintained in the Counter [sys_number_counter] table.
Although the requirement is good here that you need an auto-increment serial number field on the multi-row variable set, but I believe that it is bit problematic to make it auto-increase on basis of the previous number. Instead, I would suggest to make customers fill up the field manually with Step numbers 1,2.. and so on for mentioning the sequence.
Hope this helps.
Mark helpful or correct based on impact.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2019 11:19 AM
I think I want to ask this in a feature request because I have already run into one use case where this is desirable and I can think of several more.
The use case is add a record, then add one that should logically follow it. For now I guess it's ok if they have to fill it out of the number but it would be nice to have this functionality.