We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

dynamic field on catalog item through Virtual Agent

balochfarha
Tera Contributor

I made a topic Titled : (i need monitor ) in VA which Fetches Catalog Item ( Monitor  ) Now I want to set the description dynamically same as my prompt.Screenshot (47).png 

10 REPLIES 10

@balochfarha Those are fields on RITM table or variables in your catalog item

Variables on catalog item

 

@balochfarha I spent some time on this in my PDI and found the solution.

The custom input control returns the object which has the sys_id of RITM , so you can add another script utility after the custom input control with below script.

 

(function execute() {
   var reqInfo = JSON.parse(vaInputs.responsefromcomponent);
   var sysID = reqInfo.requestId;

   var req = new GlideRecord('sc_req_item');
   req.get(sysID);
   req.variables.description = "test from VA"; // add your description
   req.update();
})()

 

Note : Once you open the request item, after it is submitted you will see the variable populated.
Please mark the answer correct/helpful accordingly.

@balochfarha Did you get a chance to view the solution?

@balochfarha did you try this?


Please mark the answer correct/helpful accordingly.