
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 05:52 AM
Greetings-
I have a need for a testing step where i want to do the following:
- perform a record insert for a server
- open the previously created server record
- open a reference field on that form, for example the 'asset' field.
I am having trouble figuring out how to open a referenced field on a currently open form. In this case, I want to open the asset record that gets created after inserting the server CI.
Anyone kind enough to assist in how this can be done? I'm struggling with figuring out exactly how to set up any outputs to grab data to use to open the referenced field but then again, maybe I'm on the wrong path?
Solved! Go to Solution.
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 04:34 AM
Hi
Please follow the steps below to achieve your requirement:
1) When you create a CI in Server class , Asset record does not get created instantly and you need to put a Timer in your ATF flow and then check for Asset record which you want.
2) Once thee timer has been put then use the step "Record Query" and put a filter in this Record Query step by checking Configuration item is same as you have created in your first step.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 05:58 AM
Hi,
There is no OOTB option to directly open reference field record.
However, as you already have current record sys_id so you can write server side script to get sys_id of the reference field(e.g. asset in your case) value, store it in output and use it to open form in next step(open an existing record).
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Regards,
Abhijit
ServiceNow MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 06:22 AM
so it sounds like i need to create a new step with similar function as open an existing form OOTB step, then do the script and output the reference field.
i will give that a try.
thank you Abhijit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 07:06 AM
No, you don’t need to create new step. You just need to follow below steps
1. Run server script : to get sys-id of reference field
2. Record query
3. Open an existing record.
Regards,
Abhijit
ServiceNow MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 07:42 AM
but how do i access the asset field in the open form exactly?
1) Record Insert
2) Open an Existing Record (the previous created record)
3) ??? How do i access the asset field in my script ???
I guess i done quite understand how to reference the open form via script?
After record gets created in step 1, i only have access to the table where it was created and the record (sys_id) of the new created record. That is what i use to open the existing form in step 2.
how can i access the fields in the open form?