The CreatorCon Call for Content is officially open! Get started here.

Request creating from Postman application and Reference field values are not visible

Community Alums
Not applicable

Hi There,

 

 I have one requirement on third party application postman,

I have to create a Request from Postman Application,

 

 I have written one scripted rest API for creating a new Request, and i have tested via postman and new Request has been created and also RITM, but in Req and RITM form the reference fields (ex: company, department) name are populating but these values are not visible Please find the attached snapshot :

 

PriyaSm_0-1691387850739.png

 

here the company and department values are coming but not populating.

 

for this i have written one Scripted rest API, please find below:

 

 

function process( /*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response)

{

var error = '';

var catItem = '';

var cat = new GlideRecord('sc_cat_item');

if (cat.get('name', 'New Hire/Transfer')) {

catItem = cat.sys_id;

}

var cart = new Cart();

var item = cart.addItem(catItem);

cart.setVariable(item, 'company', request.body.data.company);

cart.setVariable(item, 'existing_department', request.body.data.existing_department);

var cartGR = cart.getCart();

cartGR.update();

var rc = cart.placeOrder();

response.setBody({ result: 'Catalog Item request' + rc.number + 'created.'

});

})(request, response);

 

Can anybody please help me, how can i get those values to get visible on the REQ and RITM form

 

Thanks,

 

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, unfortunately your post does not make your configuration or issue clear.
Based on your description it sounds like you are not passing appropriate values from Postman to your instance and so the company and department fields are not mapped correctly when your reeust is created.
Have you reviewed xml of your request record and confirmed that the populated sys_id's match  valid records in your instance (display values will be populated based on the sys_id's being correct).

How are you passing these values to your instance form Postman in your initial insert?

Perhaps you could share details of your Postman payload, instance response to the insert and the generated request records xml.