
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 03:26 AM
I want to create an incident with variable section through virtual agent, the same way we create through record producer.
I tried the the way by which we create RITMs but it's not working.
Solved! Go to Solution.
- Labels:
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 04:14 AM
Several ways possible. Also depending on where the information for those variables would come from.
Though, easiest would be to add a question_answer record scripted. Like below. This would already be similar as having variables when submitted through a record producer.
Personally I would consider doing this more dynamically, fetching the variables from the record producer, etc.. Though below would already work.
var grAnswer = new GlideRecord('question_answer');
grAnswer.initialize();
grAnswer.setValue('table_name', 'incident');
grAnswer.setValue('table_sys_id', 'sys_id_of_your_created_incident, maybe something like vaInputs.create_incident');
grAnswer.setValue('question', 'sys_id_of_the_variable');
grAnswer.setValue('value', 'value_for_the_variable');
grAnswer.setValue('order', '100/200/300/etc');
grAnswer.insert();
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 04:14 AM
Several ways possible. Also depending on where the information for those variables would come from.
Though, easiest would be to add a question_answer record scripted. Like below. This would already be similar as having variables when submitted through a record producer.
Personally I would consider doing this more dynamically, fetching the variables from the record producer, etc.. Though below would already work.
var grAnswer = new GlideRecord('question_answer');
grAnswer.initialize();
grAnswer.setValue('table_name', 'incident');
grAnswer.setValue('table_sys_id', 'sys_id_of_your_created_incident, maybe something like vaInputs.create_incident');
grAnswer.setValue('question', 'sys_id_of_the_variable');
grAnswer.setValue('value', 'value_for_the_variable');
grAnswer.setValue('order', '100/200/300/etc');
grAnswer.insert();
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2020 01:24 AM
Thank you so much Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2021 06:38 AM
Thank you Mark for the details.
I am still unable to create a Incident record with the Variables.
I have Catalog Item and Custom Form has been created on ServiceNow to create the request Ticket for this Item.
I am Trying to utilize those variables from Virtual agent to submit the request.
I tried to set values for the questions in Incident Table but It did not worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2021 06:38 AM
I am using Quebec..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 05:55 AM
Hi,
Is there a way to create an Incident using a Record producer? Populate the variables dynamically on the Record Producer and re-use the Record Producer script held within the Record producer? Don't want to replicate the logic within the Record producer inside my VA topic
Regards,
Ayman