Variables present in Question Table of a request is not appearing in the portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 08:10 AM
Hello All,
I have created a request from a workflow and through script I have put the variables in the "question_answer" table. It is working as expected in the backend as its showing the variables in the request
But, when accessing the request in portal, under "Request Details" it is not displaying the variables and showing as "
There are no variables associated"
Can someone help me with this?
Regards
Anirban
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 09:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 01:48 AM
Hi Rishabh,
Please find the below code. We have a custom table on creation of the record in the custom table through record producer then the RITM should be created
var item = gs.getProperty('x_hclan_gbs_financ.mdm_item'); //Record Producer "Create new and Update/Modify Location in Service Now"
var database = new GlideRecord('x_hclan_mdm_request');
database.initialize();
database.setValue('item', item);
database.setValue('source_system', "Saturn");
database.setValue('parent', current.number);
database.setValue('short_description', "Create new and Update/Modify Location in Service Now");
database.setValue('opened_by', current.opened_by);
database.setValue('requested_for', current.requested_for);
database.comments = "MDM Request created from " + current.number;
database.insert();
current.parent = database.number;
current.description = "Comment: " + current.description + "\n Request created: " + current.parent;
var comments = '';
var producerVars = new GlideRecord('question_answer');
producerVars.addQuery('table_sys_id', current.sys_id);
producerVars.query();
while (producerVars.next()) {
if(producerVars.value)
{
var gr = new GlideRecord('question_answer');
gr.value = producerVars.value;
gr.table_sys_id = database.sys_id;
gr.table_name ='sc_req_item';
gr.question = producerVars.question;
gr.order = producerVars.order;
gr.insert();
}
}
Regards
Anirban
