How do I set the sys_id value in the source script of a field mapping?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
20m ago
Hello Everyone,
I am loading data into a staging table through an inbound payload. One of the staging table fields, serverosi, contains the sys_id of a record from the cmdb_ci_computer table.
During the transform, I need to populate the target table field u_osi_server, which is a reference field to cmdb_ci_computer.
My requirement is to use the sys_id stored in the staging table field serverosi and populate the corresponding reference field u_osi_server in the target table.
What is the correct approach to achieve this in a Field Map Source Script or Transform Map? Can a reference field be populated directly using the sys_id value from the source field?
target table name: cmdb_ci_vmware_instance
Thanks,
Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8m ago - last edited 4m ago
@sattar3 Yes. You can populate the reference field u_osi_server on the target table cmdb_ci_vmware_instance directly using the sys_id stored in the staging table field serverosi, provided that the sys_id identifies a valid record in cmdb_ci_computer. A reference field stores the referenced record's sys_id internally. You do not need to query the cmdb_ci_computer table just to resolve the reference if you already have the correct sys_id. Ensure that the reference table (configured on the target dictionary field). ot required if the source value already contains the correct sysId.
