Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

On selecting one choice from Select choice Redirect user to particular link in virtual agent

Nikita35
Kilo Guru

Hi 

I wanted to check possibility of below.

When I select one of the below, It should redirect me to a link directly without clicking anything else.

find_real_file.png

I am thinking of using script action and trying something like setRedirectURL but not sure what exactly to use.

16 REPLIES 16

hi Mark,

I think this is not redirecting to other topic.

This is just like Click on Computer login account and it will redirect you directly to a link which is outside servicenow.

I think this is not achievable using Select choice Input type.

May be I can use Script output type in which I can define the links.

something like this:

find_real_file.png

 

In my case I don't have to query the tables.

But I need some help in scripting here.

In place of RITM link, I will give Computer Login account and link will be suppose www.google.com

Like that I will have 5 links for each type of account.

Let me know how you feel about this approach.

 

Tried below script in the script action:

however not working.

 

(function execute() {
var html = '';
var gr = newGlideRecord('task');
//if (gr.get(vaVars.sys_id)) {
//var tableName = gr.getValue('sys_class_name');
var fieldList = [];
var cardRenderer = new global.VaRecordCardRenderer(true);

var title = {
url: 'https://www.google.com/',
label: "Computer Login"
};
var fields = cardRenderer.createFields(fieldList, gr);
//var lastComment = cardRenderer.createField('comments', gr, null, cardRenderer.getLastComment(tableName, vaVars.sys_id));
//fields.push(lastComment);
html = cardRenderer.renderCard(title, fields);
 

return html;
})()
 
Not sure if script include is required here, can you please help?

As mentioned, I don't know if it's possible to redirect to a different URL thru a Virtual Agent chat. This also does not feel Virtual Agent specific, more like redirecting on a choice made in a widget. You could post a question which is more generic, so more people will spot your question.

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

Nikita35
Kilo Guru

Hi Guys,

Any idea on this one?

 

Satyanarayana C
ServiceNow Employee
ServiceNow Employee

Please check "Order an Item" topic in the out of the box instance. I guess it has the functionality that you want to achieve.