Recent searches
No recent searches
How to prefill the description field in the webWidget (classic) inside a custom function
Posted Dec 14, 2021
I tried to follow the docs but I did not find a solution for prefilling the description or any custom fields in the webWidget form.
I need to fill the webWidget form a JS function
<script type="text/javascript">
zESettings = {
webWidget: {
contactForm: {
title:{ '*': 'title'},
launcher:{'en-US': 'button label'},
attachments: false,
}
}
};
zE('webWidget', 'hide');
function setWidget(name,email,description){
zE('webWidget','show');
zE('webWidget','open');
zE('webWidget','prefill', {
name: {value: name},
email: {value: email},
description: {value: description}
});
}
</script>
In this code launcher does not work and the prefill description does not work. I tried to move zESettings inside the function but that did not work. I tried add the zE('webWidget', 'identify') block and that did nothing. So I do not have anything else to try please help.
zESettings works for prefiling data only on page load. Is there any other function that could be used to prefill the the description?
0
4
4 comments
Greg Katechis
Hi there! I saw that you had an open ticket regarding this issue that had some progress from where you were when you initially posted this. Regarding the description, I'm guessing that you found the correct setting to use was fields in addition to prefill. If you need to update settings after the widget has already loaded, you can also use the updateSettings command.
Finally, the reason that this shows up for the offline form is that ticket fields are not available options for chat and thus the description is not available either. Could you share with me what you're specifically looking to update on the chat form?
1
Black Belt Bots
Oh there is also update settings can you share some code to do this??
0
Greg Katechis
As for the code example in the updateSettings command, there is a snippet in the link that I previously shared with you!
0
Black Belt Bots
Can I turn the pre-chat form off?
would that solve the problem?
I need to send data to the agent before the chat starts. Can the offline form be on the whole time for example?
Is there any other solution to this problem?
0