Can we pass display value for reference variable while submitting request via OOB API

manish62
Tera Contributor

Hello Team,

 

I am using the OOB Catalog API and sending the display value for a reference variable. For sys id it's working but not for display value, could you please suggest any solution. 

 

Thanks,

Manish

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@manish62 

nope it won't work as per my understanding

1 way is to don't set that variable using Cart API or CartJS

Then use that display value to query the target table and then get sysId and then update the variable using GlideRecord

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Ankur Bawiskar
Tera Patron
Tera Patron

@manish62 

another way is to use Scripted REST API and then handle the logic in it to get the sysId based on display value and then use Cart API or CartJS

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Thank Ankur for response okay so in this case we have use scripted rest API to handle this there is no way to pass display value in OOB API (Buy Item).