In a custom app developed for Freshchat inbox, I am trying to set the data in reply editor which is fetched from a 3rd party system and using below method for the same.
client.interface.trigger(
“setValue”, {id: “editor”, value: “Text to be inserted”})
.then(function(data) {
// data - success message
}).catch(function(error) {
// error - error object
});
However It is not setting the value in the editor. I get a success response in then() and there is no error thrown in console.
Please suggest if I am missing something here. Thanks in advance.
Thanks for your response. I found the issue, the method takes the argument as “value” where as in Freshdesk and Freshservice, it is “text”. I corrected it from “text” to “value”
client.interface.trigger(“setValue”, {
id: “editor”, value:<p>${text}</p>//It was text
}).then(function () {
client.interface.trigger(“showNotify”, {
type: ‘success’,
message: “Article Added to the Reply”
});
}).catch(function () {
client.interface.trigger(“showNotify”, {
type: ‘danger’,
message: “Error while adding Article to the Reply”
});
});