How to insert Data via script for Transform maps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 06:28 AM
Hi Experts,
We are loading data for VMware machines in our cmdb_ci_vmware_instance table, however there are two fields which are not directly present in this table i.e operating system and OS Version (they are present in Windows Server table.
In form layout we have brought these 2 fields from LIST LAYOUT by server(+)
While mapping the fields how can i set the value now in cmdb_ci_vmware_instance record .
The source fields are u_os and u_operating_system
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 07:19 AM
Hi @Nisha You cannot directly set dot walked field values, usually those values comes from your original field, in your case its "server" field. In order to set those fields values you must update server record(** Note : If same server record is used under multiple VM ware records, all records gets updated) using transform scripts.
Ex:
var serverGr = new GlideRecord('server');
serverGr.get('sys_id",source.server); // *assuming server is field name, which is availabe under source, if its not getting passed then provide current object details.*
serverGr.os = source.u_os;
serverGr.update();