- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2020 05:23 AM
Hi All,
I am working on import sets and transform maps. I wanted to load one excel sheet for loading in multiple tables.
This is for loading into test case and related test case steps instance
Under test plan I have to load test cases as first step and second I have to map to test case -> test case step
so from one excel sheet
test plan -> I have load test cases
test case -> to load its related test case steps.
How can achieve using one excel sheet. Any specific coding needed for this.
Thanks,
Lean S
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2020 05:24 AM
Hi,
From single excel file you can transform data to multiple target tables.
I assume you must be having a data source to which this excel would be attached
Define the transform maps accordingly in sequence with the Order for those target tables
1st load the Test Plan
2nd Load the Test case
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 12:12 AM
Hi,
For the 2 rows, the test case numbers is different.
Thanks,
Lean S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 12:26 AM
Can you check the combinations with 1 or 2 or 3 columns from the xls and able to get single TC number.
You can update code to add more conditons by simply adding addQuery lines
var gr = new GlideRecord("tm_test_case_instance");
gr.addQuery("u_test_scenario","TCTEST "); //put right value and field that is unique if this is not.
gr.addQuery("tm_test_plan.short_description","TEST ABC"); //put right value and field that is unique if this is not.
gr.query();
gs.info("No. of rows are "+gr.getRowCount());
if(gr.next()) {
gs.info("Sys id is "+gr.sys_id.toString()+"---"+gr.number);
}
If this does not work, add 3rd column of xls to our query and check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 01:32 AM
Hi,
We have like test case -> mapped to multiple test case steps
and Test plan -> mapped to multiple test cases
so having a new field in xls and in form, it might be anything and if we try to make unique for each record, is that works for us.
Like field name: Unique Record: TC1, TC2, TC3 like that as string field.
Please suggest
Thanks,
Lean S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 01:38 AM
If there is a possibility for you to add a field in your table and in xls, then yes, that the best option. Something like TC number which is unique per your test case.
Once you add that, then have this query checked with that
var gr = new GlideRecord("tm_test_case_instance");
gr.addQuery("u_new_field","TC01"); //put right value and field that is unique if this is not.
gr.query();
gs.info("No. of rows are "+gr.getRowCount());
if(gr.next()) {
gs.info("Sys id is "+gr.sys_id.toString()+"---"+gr.number);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 02:27 AM
Hi,
I have loaded some records and I checked like mentioned:
Code:
var gr = new GlideRecord("tm_test_case_instance");
gr.addQuery("u_unique_record","TC1"); //put right value and field that is unique if this is not.
gr.query();
gs.info("No. of rows are "+gr.getRowCount());
if(gr.next()) {
gs.info("Sys id is "+gr.sys_id.toString()+"---"+gr.number);
}
Kindly Suggest,
Thanks,
Lean S