Transform map .

naveenvenka
Tera Contributor

There is feild in staging table called created , which is in mutliple formats like GMT , IST etc..
before inserting the data into target table , need to change created on every record to IST
Can someone help how can i approach this one.

1 ACCEPTED SOLUTION

Pradeep Thipani
Mega Sage

Hi @naveenvenka ,

 

You need to use a Transform Script for this. In the onBefore Script, check the source record’s timezone and then convert it into the required timezone before inserting into the target table.

 

Thanks,

Pradeep

 

 

"If this response was useful, please select 'Accept as Solution' and mark it as 'Helpful.' This helps me provide better answers and assists the community ".

Regards,
Pradeep

View solution in original post

5 REPLIES 5

Pradeep Thipani
Mega Sage

Hi @naveenvenka ,

 

You need to use a Transform Script for this. In the onBefore Script, check the source record’s timezone and then convert it into the required timezone before inserting into the target table.

 

Thanks,

Pradeep

 

 

"If this response was useful, please select 'Accept as Solution' and mark it as 'Helpful.' This helps me provide better answers and assists the community ".

Regards,
Pradeep

naveenvenka
Tera Contributor

Hi @Pradeep Thipani ,

Thanks for answering the question , but my main aim to get the logic in the form of code.
Can you please give in the form of code if its possible.

Really apperciate your efforts.

Bhuvan
Tera Sage

@naveenvenka 

 

Create onBefore transform script to convert staging field 'created' to IST timezone and insert to target table as part of transform mapping.

 

You can refer below thread to convert date-time field to IST timezone. 

 

https://www.servicenow.com/community/developer-blog/convert-timezone/ba-p/2287262

 

As per community guidelines, you can accept more than one answer as accepted solution. If my response helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

@naveenvenka 

 

Did you get a chance to review this ? Reference I provided has the code that you can use in onBefore transform script.

 

As per community guidelines, you can accept more than one answer as accepted solution. If my response helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan