What is COALESCE explain with example

Apsara P
Tera Contributor

Please Help me

8 REPLIES 8

Dan O Connor
ServiceNow Employee
ServiceNow Employee

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 IDNameCountryRole
001JohnIrelandSales
002SarahEnglandIT
003AmyScotlandHR
004BradAmericaMarketing

 

Here is the data that exists in the User table already

Employee IDNameCountryRole
001John Sales
002SarahEngland 
003 ScotlandHR

 

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

 

Employee IDNameCountryRole
001JohnIrelandSales
002SarahEnglandIT
003AmyScotlandHR
004BradAmericaMarketing

 

Nice explaination thankyou !

Nice Explanation thankyou!

 

Thanks for explaining in simple way.