How to store value in reference variable through scripted rest API

SK36
Tera Contributor

Hi Experts,

I have created 4 variables.

1) Requested for - reference field

2)mobile number - single line text

3)short description - single line text

4)detailed description - single line text

I am trying to store values through scripted rest API.

values are storing in mobile number, short description, detailed description variables. Because these are just single line text. But value is not storing in Requested for variable because it is reference field. 

I have attached my request format. Any help would be appreciated.

find_real_file.png

 

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi

references are stored internally as Sys IDs. So passing any name doesn't help. Either you look up by yourself the display name to fetch the Sys ID or you pass the Sys ID.

Maik

View solution in original post

2 REPLIES 2

Maik Skoddow
Tera Patron
Tera Patron

Hi

references are stored internally as Sys IDs. So passing any name doesn't help. Either you look up by yourself the display name to fetch the Sys ID or you pass the Sys ID.

Maik

Vasantharajan N
Giga Sage
Giga Sage

You can take the unique field value like user_name or email in sys_user table for requested for field as a parameter then in your scripted restAPI have function to get the user sys_id using the value and set it to the variable.


Thanks & Regards,
Vasanth