The CreatorCon Call for Content is officially open! Get started here.

Transform Map help !!

vidishaagarwal5
Tera Contributor

In a ServiceNow Transform Map, how can you restrict the insertion of new records and allow only updates to existing records during data import?

3 ACCEPTED SOLUTIONS

Ravi Gaurav
Giga Sage
Giga Sage

Hi @vidishaagarwal5 

 

In transform map main script, we can check for operation by using 'action' variable and set 'ignore' variable as true/false based on the value as shown in below script :

if(action=='insert'){
ignore=true;
}

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

Ravi Gaurav
Giga Sage
Giga Sage

Below Will help you to understand Transform Map !!

https://www.servicenow.com/docs/bundle/zurich-integrate-applications/page/script/server-scripting/co...

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @vidishaagarwal5 

 

use the coalesce. 

Coalesce is commonly used with Transform maps in ServiceNow. It is used to set a field as unique, so that when data is imported :

- If ServiceNow identifies the data against an existing record using Coalesce, then it will update that record.

- If ServiceNow identifies the data against no existing records, it creates a new one.

 

So lets take this as a simple example, we want to load the below User information through Transform Maps into our User table. We set Employee ID as the Coalesce field

 

Here is the data we are loading in. 

Employee ID Name Country Role
001 John Ireland Sales
002 Sarah England IT
003 Amy Scotland HR
004 Brad America Marketing

 

Here is the data that exists in the User table already

Employee ID Name Country Role
001 John   Sales
002 Sarah England  
003   Scotland HR

 

Here is what the table would look like after the transform map runs

 

Employee ID Name Country Role
001 John Ireland Sales
002 Sarah England IT
003 Amy Scotland HR
004 Brad America Marketing

 

https://youtu.be/vKIQ1IZDP10

*************************************************************************************************************
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]

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

View solution in original post

csa #ServiceNow #TechnoFuncational Disclaimer: These videos are from my training batch. These videos did not promote any ServiceNow Sales pitch or marketing. These videos are only for knowledge purposes based on my experience and knowledge. Redistribution or copying of functionality is not ...
5 REPLIES 5

Ravi Gaurav
Giga Sage
Giga Sage

Hi @vidishaagarwal5 

 

In transform map main script, we can check for operation by using 'action' variable and set 'ignore' variable as true/false based on the value as shown in below script :

if(action=='insert'){
ignore=true;
}

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

Ravi Gaurav
Giga Sage
Giga Sage

Below Will help you to understand Transform Map !!

https://www.servicenow.com/docs/bundle/zurich-integrate-applications/page/script/server-scripting/co...

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @vidishaagarwal5 

 

use the coalesce. 

Coalesce is commonly used with Transform maps in ServiceNow. It is used to set a field as unique, so that when data is imported :

- If ServiceNow identifies the data against an existing record using Coalesce, then it will update that record.

- If ServiceNow identifies the data against no existing records, it creates a new one.

 

So lets take this as a simple example, we want to load the below User information through Transform Maps into our User table. We set Employee ID as the Coalesce field

 

Here is the data we are loading in. 

Employee ID Name Country Role
001 John Ireland Sales
002 Sarah England IT
003 Amy Scotland HR
004 Brad America Marketing

 

Here is the data that exists in the User table already

Employee ID Name Country Role
001 John   Sales
002 Sarah England  
003   Scotland HR

 

Here is what the table would look like after the transform map runs

 

Employee ID Name Country Role
001 John Ireland Sales
002 Sarah England IT
003 Amy Scotland HR
004 Brad America Marketing

 

https://youtu.be/vKIQ1IZDP10

*************************************************************************************************************
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]

****************************************************************************************************************
csa #ServiceNow #TechnoFuncational Disclaimer: These videos are from my training batch. These videos did not promote any ServiceNow Sales pitch or marketing. These videos are only for knowledge purposes based on my experience and knowledge. Redistribution or copying of functionality is not ...

vidishaagarwal5
Tera Contributor

Thanks @Ravi Gaurav  the code worked for me.. thanks @Dr Atul G- LNG  it helped me understand more in depth. your videos are good