How to call REST Message or Script Include from Virtual Agent

Enrico Domingo
Kilo Contributor

Hi,

How can we call Script Include or REST Message from Virtual Agent script? can we use GlideAjax?

(function execute() {
      var gdt = new GlideDateTime();
      var gt = new GlideTime();
      gdt.addSeconds(7200);
      gt = gdt.getTime();
      var multiOutMsg = new sn_cs.MultiPartOutMsg();
      multiOutMsg.addPlainTextPart('Thank you for submitting an incident.');
      multiOutMsg.addPlainTextPart('You should receive a response from a technician by ' + gt.getByFormat('HH:mm'));
      return multiOutMsg;
})()
3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

it's server side so you can directly use REST Message

Regards
Ankur

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

Mark Roethof
Tera Patron
Tera Patron

Hi there,

An old article already, though still works:
- 2020-05-04 Calling Events, REST, Flow Designer, Workflows through Virtual Agent

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Any follow-up needed? Or was my answer sufficient?
Let me know.

If your question is solved, please close the topic by marking my answer as correct. This will help others searching for a similar question and will remove the topic from the unsolved list.

Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn