Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Chat Subject Field

    Posted 02-03-2021 13:23
    I have created a chat widget. Within the widget there are the default fields, including subject. I don't see the subject appear anywhere on screen for the advisor. It does not appear to be a default variable in the scripts. Has anyone managed to get the chat subject to appear for advisors? If so, would you care to share how? It's breaking me :)
    #ConnectwithaCustomer(NEW)
    #DigitalChannels
    #Omni-ChannelDesktop/UserInterface

    ------------------------------
    Mark Elliott
    Lemon Business Solutions
    ------------------------------


  • 2.  RE: Chat Subject Field

    Posted 02-03-2021 14:57
    This is the widget code I have which gives me a company name and subject field in the popup. But neither of these will appear in the chat window for the advisor: 

    <script src="https://apps.euw2.pure.cloud/widgets/9.0/cxbus.min.js" onload="javascript:CXBus.configure({debug:false,pluginsPath:'https://apps.euw2.pure.cloud/widgets/9.0/plugins/'}); CXBus.loadPlugin('widgets-core');"></script>

    <script>
    window._genesys = {
    "widgets": {
    "webchat": {
    "transport": {
    "type": "purecloud-v2-sockets",
    "dataURL": "https://api.euw2.pure.cloud",
    "deploymentKey": "mykey",
    "orgGuid": "myorg",
    "interactionData": {
    "routing": {
    "targetType": "QUEUE",
    "targetAddress": "Test - Chat",
    "priority": 2
    }
    }
    },
    "userData": {
    "addressStreet": "",
    "addressCity": "",
    "addressPostalCode": "",
    "addressState": "",
    "phoneNumber": "",
    "customField1Label": "Company Name",
    "customField1": "",
    "customField2Label": "",
    "customField2": "",
    "customField3Label": "",
    "customField3": ""
    }
    }
    }
    };

    function getAdvancedConfig() {
    return {
    "form": {
    "autoSubmit": false,
    "firstname": "",
    "lastname": "",
    "email": "",
    "subject": "",
    "company": ""
    },
    "formJSON": {
    "wrapper": "<table></table>",
    "inputs": [
    {
    "id": "cx_webchat_form_firstname",
    "name": "firstname",
    "maxlength": "100",
    "placeholder": "Required",
    "label": "First Name"
    },
    {
    "id": "cx_webchat_form_lastname",
    "name": "lastname",
    "maxlength": "100",
    "placeholder": "Required",
    "label": "Last Name"
    },
    {
    "id": "cx_webchat_form_email",
    "name": "email",
    "maxlength": "100",
    "placeholder": "Optional",
    "label": "Email"
    },
    {
    "id": "cx_webchat_form_subject",
    "name": "subject",
    "maxlength": "100",
    "placeholder": "Optional",
    "label": "Subject"
    },
    {
    "id": "cx_webchat_form_company_name",
    "name": "company",
    "maxlength": "100",
    "placeholder": "Optional",
    "label": "Company Name"
    }
    ]
    }
    };
    }

    const customPlugin = CXBus.registerPlugin('Custom');
    </script>

    <button type="button" id="chat-button" onclick="customPlugin.command('WebChat.open', getAdvancedConfig());">Start Chat</button>

    ------------------------------
    Mark Elliott
    Lemon Business Solutions
    ------------------------------



  • 3.  RE: Chat Subject Field

    Posted 02-03-2021 15:18
    Mark,

    In your architect chat flow, I'd to use the Get Participant action to assign context.company and context.subject to variables.  Use a Set Screen Pop action to assign those variables to your script where you would like the company name and the subject to appear in the pop.   




    ------------------------------
    Jason Tripp
    Independent Health Association, Inc.
    ------------------------------



  • 4.  RE: Chat Subject Field

    Posted 02-05-2021 06:14
    Thank you Jason, hugely appreciate it. I was close but still no cigar. So I have my flow set up to get participant data as below. The attribute name is set to context.subject and the variable assigned is Flow.subject. I have also tried this as State.subject which also didn't work.



    in my Set Screen Pop I have the context.subject being set to the Subject variable for my script: 


    The Flow.subject can be seen to be in use as a variable: 

    In my script I have the variable Subject being called

    And it is set as an input variable string: 


    I'm sure there's something silly I am doing/missing - when I put a chat through as a test like below: 


    I get the text "context.subject" as the Chat Subject in my script. 




    I've tried fiddling with the options but can't get the behaviour to change to actually pass me the subject. 

    I do wish GC would have made subject a standard field from the Chat for the script to avoid having to configure it through this means - although where would the fun be in that :) 

    Thanks again - any help or direction would be greatly appreciated.

    ------------------------------
    Mark Elliott
    Lemon Business Solutions
    ------------------------------



  • 5.  RE: Chat Subject Field

    Posted 02-05-2021 06:28
    I've solved it - leaving here for anyone else struggling - I needed to set the screen pop to still look for the variable Flow.subject:



    ------------------------------
    Mark Elliott
    Lemon Business Solutions
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources