Create multiple records using transform map
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 01:54 PM
Hi,
We have an excel file which will be imported into Servicenow instance on daily basis and there is separate form to import the data using the excel. Both the methods are using the same transform map to import and update/create the asset records in the system. The requirement has changed right now, in the excel i have multiple columns, out of them there are three specific columns which i need to look and create two records based on that.
Example we have Column A, Column B, Column C. If the data is present in all the columns then i need to create two records with different device types in Asset records. if the data is not present in Column A or Column B then i can create only one record through transform map.
How to achieve the above requirement? I can use business rules to insert another record and delete the details of few columns from previously created record but its not good idea as it will effect the performance.
Writing a schedule job is the second option i could think of but this option doesnt work in case of Catalog form as the changes needs to be reflected asap.
Please let me know if its possible to insert using same row in excel using transform map or what is the best approach in this scenarion?
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 12:30 PM
Hi @OlaN ,
I agree with you but the whole idea is to differentiate between Mobile phones and Line numbers assigned to the user. For this reason only i have created another device type as 'Mobile Line' other than 'Mobile' device type. So in the excel we have details of MSISDN, IMEI and SIM number. If all the details are present then i should create two records under two different device types "Mobile" with IMEI as serial number and "Mobile Line" with MSISDn+Sim No as Serial number so that the team can identify if line is assigned to the user and provide related access accordingly. If IMEI is missing iam going to mark that record as "Mobile Line' and if MSISDN is missing then i will be creating the record under 'Mobile' device type. Hope you understand the requirement and why iam doing it.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 02:47 AM
I'm beginning to understand your reasoning.
I guess continuing down that path is doable, but complicated. I try to avoid complicated whenever possible.. 😀
You will have to do a lot of scripting to determine when a new record should be created and when not, also if doing coalesce on say IMEI column in the import data, a row that has empty coalesce will be skipped, but then a record still might be created by these transform script identifying MSISDN as a new record. This will lead to hard-to-follow scenario/debugging if a question should arise like "Why did this record get created?"
Also (and I might be picky here), but you said earlier you imported these records to the alm_hardware table.
To me, a record that is defined as a "Mobile Line" is not a hardware record. It's more something that might belong in a CMDB-table.
So I would still consider separating this data into two different tables.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 08:53 PM - edited 07-27-2023 08:53 PM
I agree with Olan. Also there is an other option you can explore which is Post script on the import schedule job. It runs after job completes.
You can glide through imortset table and check if all 3 columns A,B and C has values and create the second device type.
Consider the volume of record, it may take longer run time if there are more records.
Please mark helpful and correct if it works!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 03:44 AM
Hi Merc,
Did you find the solution for this?