Virtual Agent Dynamic Choice. How to change prompt that comes up when there is only one option?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 10:50 AM
I have a Dynamic Choice component in a Virtual Agent flow.
The Node name is "Choices"
The Prompt should be: "Please choose the device you are having issues with"
I'm populating the options from a json in the following way:
(function execute() {
var options = [];
var jsonObject = JSON.parse(vaInputs.json);
for (var device in jsonObject.Devices){
options.push({
'label': JSON.stringify(jsonObject.Devices[device].Model),
'value': JSON.stringify(jsonObject.Devices[device].Model)
});
}
return options;
})()
I tested it with an array that has only one entry (one device), and instead of getting the prompt and then the option, I get this:
We have "iPhone 11 (64 GB Red)" as Choices, is this correct?
[Yes/No]
Evidently what happens is that when there is only one choice, it just turns into a Yes/No question and the prompt is: "We have {option} as {Node Name} is this correct?"
How can I modify that prompt? I don't want it to use the node name, it's a terrible idea. You'd end up with a node in the flow that's called "one of your devices" or something that makes sense in the chat, but not in the designer.
Thanks
- 1,356 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 10:03 AM
Hi Nicolas,
Did you find any solution for this?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2024 03:41 PM - edited 06-27-2024 03:41 PM
Any solution for this? It's as though a topic I've been working on randomly started doing this, ignoring my prompt. Unless I was only ever testing with two active records, I'm pretty sure you had to physically click the link in the dynamic choice input prompt but now it's giving me this garbage 'We have...' (name of record) as 'node name'
Who came up with this!?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2024 03:44 PM - edited 06-27-2024 03:46 PM
Found this:
Note:
If you populate a Dynamic Choice list node with only one choice, when testing or using the node, you receive a message reading We have [choice] as [node name], is this correct?. Use multiple choices in the Dynamic Choice list node to avoid receiving this message.
You can also alter the message content by navigating to ALL > sys_properties.list and editing the glide.cs.retry_question_message system property. This message value is by default a string We have {0} as {1}, is this correct? and is used for slot-filling in multiple cases outside the Dynamic Choice list. Any changes you make are reflected in every use of this property.
Lovely so I wouldn't recommend changing that.
Dynamic Choice user input control (servicenow.com)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 10:38 AM
For someone who is still looking for the solution:
We can display our customized prompt from Advanced (Optional) --> Confirmation Messages --> "Default value confirmation". This prompt is visible only when the Defined Choice list returns a single option.