
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2023 11:44 PM
Can anyone provide a simple script in Agent Chat - Quick Actions to execute a Flow Designer action and to pass a simple response back to the chat screen?
Is there an example of how to do this that I may have missed, is this even possible?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 04:30 AM
Worked out that you can simply use the Create code snippet, server code NOT client code.
For example, you can use the following code in the Script field of the [quickactions_action] record.
var message = "";
var inputs = {};
inputs['prompt'] = params[0]; // String
var result = sn_fd.FlowAPI.getRunner().action('global.MY_CUSTOM_ACTION').inForeground().withInputs(inputs).run();
var outputs = result.getOutputs();
var my_response = outputs['answer']; // String
message = my_response;
sn_connect.Conversation.get(record.channel_metadata_document, record.channel_metadata_table)
.sendMessage({
body: message,
system: false
});
answer = {
success: true,
message: message,
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 04:30 AM
Worked out that you can simply use the Create code snippet, server code NOT client code.
For example, you can use the following code in the Script field of the [quickactions_action] record.
var message = "";
var inputs = {};
inputs['prompt'] = params[0]; // String
var result = sn_fd.FlowAPI.getRunner().action('global.MY_CUSTOM_ACTION').inForeground().withInputs(inputs).run();
var outputs = result.getOutputs();
var my_response = outputs['answer']; // String
message = my_response;
sn_connect.Conversation.get(record.channel_metadata_document, record.channel_metadata_table)
.sendMessage({
body: message,
system: false
});
answer = {
success: true,
message: message,
};