Need to move the data from one table to another in the same instance

Community Alums
Not applicable

Hi All, 

 

Having a requirement that, need to transfer the data from one table to another. 

The data we are getting the api push in a schedule timeline to instance from teh client environment. and this data need to move to main target table. 

 

Need suggestion on processing this. 

we tried to created a transform map and try to run through schedule job. But its not working. Any other possible way. 

10 REPLIES 10

J Siva
Tera Sage

Hi @Community Alums 
If the data is not being stored in the import set table and you are directly storing that in the normal table, then the transform map won't work.
You can use business rule / flow to create a copy of the record in the main target table. 
As a best practice, either push the data dircetly to the main target table OR push it to the import set table and then with the help of transofrm map you can load that to the main target table.

 

Regards,
Siva

Community Alums
Not applicable

Hi Shiva, 

 

Thanks for the response. Here the data is getting stored in the staging table only and from that want to move it to target table. 

we created a transform map and later to run this we needed a data source. And in that 

chanti1_0-1743411229094.png

what can try to select the type to run this Transform. 

Bit stucked here. 

 

Robert H
Mega Sage

Hello @Community Alums ,

 

The approach depends on the particular scenario you are facing. It sounds like the data gets pushed to your instance. What kind of table is it getting pushed to?

 

If it is an Import Set Table (a table that is extended from "Import Set Row" [sys_import_set_row]) and the data is getting pushed through the Import Set API and you have defined Transform Maps on that table then it should get moved to the target table automatically.

 

If your source table is a regular table then you would have to create a Fix Script (if you are looking for a one-time solution and then want to get rid of the original table) or Business Rule (if having two tables it a permanent solution) that moves the data to the target table.

 

Regards,

Robert

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

you can create an import set API and configure the fields which will hold data.

This API will be consumed by 3rd party and when they push the data to that import set, the transform map linked to this staging table will perform the transformation to target table

this link explains it well, ensure you give the correct authentication details to 3rd party team

Using Import Sets for REST Integration in ServiceNow 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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