How to insert old records in new field

keval3
Tera Contributor

Hi All,

 

I have below requirement,

in form there is one field called Old Current outcomes with string type. in in that field data comes from SAP. Now I have created new field called  New Current Outcomes and now I want that once data comes in Old current outcomes field the data will automatically get populate in new current outcomes. 

Note: New current outcomes type is Floating point no.

 

Please let me know the solution so I can get the same data on new field.

 

Thanks & Regards

KP

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @keval3 

 

Automatic will not work also the data type has been changed. So first make sure all old values be in Floating type and then either via script or manual if count is less update the new value. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hi Atul,

The count is 5k something and in old field values are floating only

Thanks & Regards

KP 

Hi @keval3 

 

2 ways

- Create back ground script and then populate the new values  ( I am not sure about script sorry)

- Create a new transform map on 2 field, 1 record number and 2 fields for new value

and run the map ( via import set).

Try on dev with 5-10 values. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

@keval3 

1. you need to Remove the Mapping from where you Configured the SAP Integration and Map the New Field 

2. In order to Transfer old field data to new Field data and design below Script 

var gr= new GlideRecord('');//Pass the Table name 

gr.query();

while (gr.next()) {
 
  gr.oldfieldbackendvalue= gr.newfieldbackendvalue;

  gr.update();
}

 

let me know if you need any more help 

 

Regards,

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar