- 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
‎10-31-2020 10:41 AM
Hi,
I am attaching an sample sheet, which contains records in green and yellow. Green coloured fields I am using to load on to test case table (test cases are under test plan) (1st transform map) and Yellow coloured ones mapped in 2nd for test case instance table
Let us say 2 records created 2 test cases (TMTC0001 & TMTC0002) and now automatically we have create records for this in Test case instance table under this 2 records.
Thanks,
Lean S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2020 11:49 AM
Okay.
IS the TP Number stored in your test case table and is it unique per test case?
If yes, then you can use that to query the test case sys_id and link it to the 2nd table.
Map TP Number with this column tm_test_case_instance in your 2nd transform map. Then click on that TP Number field and enable source script and add below code.
var gr = new GlideRecord("sn_test_management_test_version");//MENTION test case table
gr.addQuery("tp_number",source.u_tp_number); //Put correct field names
gr.query();
if(gr.next()) {
source.u_tp_number=gr.sys_id.toString();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2020 08:12 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2020 12:20 AM
Hi,
Yes, it should work as per the flow that you have mentioned.
Kindly answer these questions.
1. Is TP numbers stored in your test case table or not?
2. In the 2nd transform map, did you map the TP number with the tm_test_case_instance ?
3. Share the latest source script that you have.
Kindly mark the comments as helpful if they are helping to debug.
Also, let me know if you are on zoom where we can look into the issue together.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2020 09:18 AM
Hi Asifnoor,
Thanks for the reply.
I have checked below:
1. Yes TP_number is stored in TEST CASE table
2. In the 2nd transform map (Test Case Step table (test)), do you mean to say mapping TP_number to Test Case steps table. find below screenshot
Source field now changed to TC_number (test plan number) but data is same as previous.
3. Plz find below source script:
tm_test_case_instance is the TEST CASE table value. A small question here do I need to do same as in 2nd point to map TC_number to TEST case field and select use source script checkbox to true?
Please suggest.
And Sorry I am not on Zoom.
Thanks,
Lean S