How to Get Record sys id ATF

John Doe
Giga Expert

Hi I am working on ATF, where I have Open a Record in List step, after that step I need sys_id of the record opened in Open a Record for  run server side script.  

I tried 

var test = steps('sys_id').record_id;

stepResult.setOutputMessage(test);

Its showing output as 

undefined

 

Please help

1 ACCEPTED SOLUTION

@John Doe 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Community Alums
Not applicable

Hi John Doe,

You can use previous step sys_id to get submitted record sys_id by following way.

var STEP_SYS_ID = '6989f601376023008020036973990ebc';   // Your Submit form test step sys_id

var record_sys_id = steps(STEP_SYS_ID).record_id);  // get submitted form record sys_id

 

Mark my answer correct & Helpful, if Applicable.

Thanks,
Sandeep

I am not submitting any form , I am just opening existing record

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Can you share your steps screenshot

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

find_real_file.png