[Virtual Agent] - Display images on Carousel input

Vinicius Justo
Kilo Contributor

Hi all,

I have some images that are stored within (ServiceNow > System UI > Images) and I would like to know how to display these images on a carousel activity. Is there any better place to store images to be used on SNow VA?

(function execute() {
       var options = [];
       options.push(
            {
                'Name': 'name1',
                'Value': 'value_1',
                'Body': 'https://wrawnwrawns.servicenow.com/viniimage.jpg'
            }
       );

       return options;
})()
1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Your code looks oke (haven't validated thru a editor or something). Is it not working, or do you just have a question?

We are utilizing the Images table also for this. Examples of this, you can see in 2 articles I wrote about Virtual Agent:
https://community.servicenow.com/community?id=community_article&sys_id=7d174d74db54b744d82ffb2439961...
https://community.servicenow.com/community?id=community_article&sys_id=3cbe2007dbed7b84f7fca851ca961...

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

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

View solution in original post

2 REPLIES 2

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Your code looks oke (haven't validated thru a editor or something). Is it not working, or do you just have a question?

We are utilizing the Images table also for this. Examples of this, you can see in 2 articles I wrote about Virtual Agent:
https://community.servicenow.com/community?id=community_article&sys_id=7d174d74db54b744d82ffb2439961...
https://community.servicenow.com/community?id=community_article&sys_id=3cbe2007dbed7b84f7fca851ca961...

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

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

My code was not working properly so I just modified the option's body property to receive baseURL (glide.servlet.uri) and it worked perfectly. Thanks!

 

(function execute() {

    var baseURL = gs.getProperty('glide.servlet.uri');

    var options = [];
      options.push(
            {
                'Name': 'name1',
                'Value': 'value_1',
                'Body': baseURL + '/' + 'image1.jpg'
            }
       );

        options.push(
            {
                'Name': 'name2',
                'Value': 'value_2',
                'Body': baseURL + '/' + 'image2.jpg'
            }
       );
       
       return options;
})()