REST API of Database view, fetching variables and catalog task fields

Prabhat4
Tera Contributor

Hello Developers,

I've crated a Database view and created a table api of the table created. After applying sysparm_fields, i'm fetching variables on the catalog task and other task fields. The Road block is whenever variable is reference type then in response i'm getting sys_id as value, instead of sys_id we need the display value.  I know we can do this via scripted REST API, However we want to do it via database view only, If any help can be done then that would be great.

I'm attaching screenshots of both the outputs that is from scripted rest and database view table api.

find_real_file.png

find_real_file.png

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Prabhat,

in the sysparm_fields you can dot walk and get the display value;

op_value is a reference field which points to some table; that table must be having some name etc column which is display  = true

use that in sysparm_fields

op_value.name 

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur,

I've done this, it didn't worked. If i'm using dot walking then that fields itself is not coming in response.

Value column in Options table is string type and i've set the display to true in dictionary as well, again didn't worked. sysparam_dispaly_value is already true.

Ahmmed Ali
Mega Sage

Hello,

 

Did you try adding 

sysparm_display_value=true

in API ?

 

Thanks,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Hi Ahmmed,

I've done this, it didn't worked. If i'm using dot walking then that fields itself is not coming in response.

Value column in Options table is string type and i've set the display to true in dictionary as well, again didn't worked. sysparam_dispaly_value is already true.