I have used the following code before for Live Chat and it's working fine to direct to a button ID based on the Pre chat question customer answers. Now, this code seems to be not working when I started using the new 'Channel Menu'. Has anyone found a solution to direct to button routing if use a channel menu?

embedded_svc.settings.directToButtonRouting = function(prechatFormData) {
          if (prechatFormData[3].value === 'English') 
            return 'XXXX000000XYYY';
          if (prechatFormData[3].value === 'Spanish') 
            return 'XXXXX000000XAAA';
          if (prechatFormData[3].value === 'French') 
            return 'XXXX000000XBBB';
  • By not working, are you seeing any error ?
    – Swetha
    Sep 6 at 16:08
  • @swetha Yes, I was getting "Uncaught TypeError: Cannot set properties of undefined (setting 'directToButtonRouting') at initESW". And I was getting this only for Channel Menu code
    – regidsites
    Sep 7 at 1:25
  • Does my answer on developer.salesforce.com/forums/ForumsMain?id=9062I000000Bl36 help?
    – Swetha
    Sep 8 at 11:14
  • 1
    @Swetha, Thanks for that. But, is there a way we can pass the pre chat data to Transcript object when using "Channel Menu"'s Live Chat?
    – regidsites
    Sep 8 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.