Virtual Agent Dynamic Choice Input calling Script include
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2024 11:40 PM - edited ‎09-09-2024 11:41 PM
Is it possible to call script include Choice input?
I have a script include that returns an object and this is how I call it in the script inside the Dynamic Choice input. Now I already have tested my script include in the background script and it's working fine but whenever I call it here in the Dynamic Choice input script it does not work, it errors if I don't put global.scriptinclude or i put global it does not error but does not return any choices. Here's the script that I used to call the script include
(function execute() {
var nearbyStations = new ChargingStationLocator();
nearbyStations.findNearbyStations(parseFloat(vaInputs.latitude),parseFloat(vaInputs.longitude),0.03);
var options = [];
for (var i = 0; i < nearbyStations.length; i++) {
options.push({'value':nearbyStations[i].latitude+","+nearbyStations[i].longitude ,'label': nearbyStations[i].name});
}
return options;
})()
Labels:
- Labels:
-
Virtual Agent
0 REPLIES 0