Can we insert Foreign record in transform map?Like we did in SQL

sanyalshubh
Tera Contributor
 
2 ACCEPTED SOLUTIONS

Ravi Gaurav
Giga Sage
Giga Sage

Hi @sanyalshubh 

A foreign record insert occurs when updating a reference field on a target table. If reference field doesn't exist then transform map creates new entry in reference table. This behaviour can be managed by 'Choice Action' field on field mapping record.

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


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

Sandeep Rajput
Tera Patron
Tera Patron

@sanyalshubh 
Yes, you can insert records into a foreign table in a Transform Map in ServiceNow using the onBefore or onAfter script in the transform map. This is similar to how you would handle foreign record insertion in SQL. The foreign table can be any table that isn’t the target table of the current Transform Map.

View solution in original post

2 REPLIES 2

Ravi Gaurav
Giga Sage
Giga Sage

Hi @sanyalshubh 

A foreign record insert occurs when updating a reference field on a target table. If reference field doesn't exist then transform map creates new entry in reference table. This behaviour can be managed by 'Choice Action' field on field mapping record.

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


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/

Sandeep Rajput
Tera Patron
Tera Patron

@sanyalshubh 
Yes, you can insert records into a foreign table in a Transform Map in ServiceNow using the onBefore or onAfter script in the transform map. This is similar to how you would handle foreign record insertion in SQL. The foreign table can be any table that isn’t the target table of the current Transform Map.