Option for multi-selection in virtual agent

Ajay30
Mega Guru

I wanted to give users an option to do multi-selection of records from Virtual Agent, just like a 'list_collector' type of field does. Is there anyway I can achieve it?

3 REPLIES 3

Chris D
Kilo Sage
Kilo Sage

I haven't done this but it's an interesting subject - curious if anybody has implemented it.

A list collector is just a comma-separated list right? Could you just loop through a reference input and write each entry into a string Variable?

I always preface them with a text input as search, so I'd imagine it could look something like:

  1. [Text] Enter search term
  2. [Reference] Select your item
  3. [Script] Write sysid to vaVar
  4. [Yes/No] Do you want to add another item?
  5. If yes, loop back to 1
  6. Continue topic
  7. [Script] Do something with vaVar - i.e. write to List field/List Collector variable

Hi Chris,

Thanks for your reply.

This could be an alternate way but I would say not very user friendly.

I think ServiceNow VA should provide such functionality in future release. Let's see 🙂 

Guy10
Tera Contributor

You should use the Script Variable to achieve it

create loop like Chris suggested and update the 'script variable' in script action option. for example (name of the variable which need to be create is Role)

(function execute() {
vaVars.Role+=','+vaInputs.role_anodot;
})()
 
just notice that if you don't insert a default value to the variable - in the array the first value will be 'null'.