Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to increment the field value for the existing records in the table.

Gowtham3
Giga Contributor

Hi All,

There is a table with 10 Records with one of the fields having values like 1,1,2,2,3,3,4,4,5,5.

Let's say

Record 1 has 1

Record 2 has 1

Record 3 has 2

Record 4 has 2

Record 5 has 3 and so on

I want to set a new value for these existing records as "ABC001" and the subsequent records should get incremented to "ABC002", "ABC003" ...... "ABC010".

 

Is there a way to do this?

 

Thanks,

Gowtham

 

6 REPLIES 6

Priyanka Chandr
Mega Guru

Hi,

Please have a look into this that will also help you

https://community.servicenow.com/community?id=community_question&sys_id=dc764fe1db1cdbc01dcaf3231f96...

Please mark it correct and helpful.

Thanks,

 

Hi Priyanka,

But, i think in background scripts, this function will not work right getNextObjNumberPadded().

Maybe in some server script, we must write I guess.

But in order to change/update the existing records, we need to use background scripts know.

 

Correct me if I am wrong.

 

Thanks,

Gowtham