PureConnect

Discussion Thread View
Expand all | Collapse all

Sending custom values from a WebChat Widget using Extensions

  • 1.  Sending custom values from a WebChat Widget using Extensions

    Posted 05-18-2020 23:54
    Edited by Umair Khan 05-20-2020 20:03
    hi,

    I have been trying to send widget form parameters to PureConnect after following the documentation. The easiest way i could find is to post form values to Chat Notes as the link suggests: - https://help.genesys.com/pureconnect/mergedprojects/wh_basl_connect/desktop/pureconnect_widget_extensions.htm

    WebChatService.setChatNotes

    This function takes in an object that defines notes that should be set on a PureConnect chat.  This function must be called prior to a chat being started.

    Example:

    service.command("WebChatService.setChatNotes", {
        notes: "notes"
    });

    As the function description mentions, it needs to be called before the chat is being started. how can i set notes with the selected values from the web chat form? Intention is to send Member ID entered on the text box in the web chat form to the Interaction Notes section in Interaction Connect.

    Here is how i was trying to do: -

    Can someone assist here? If this is the right approach to send custom form values to Interaction connect?

    Thanks
    //UK
    #Implementation

    ------------------------------
    Umair Khan
    ------------------------------


  • 2.  RE: Sending custom values from a WebChat Widget using Extensions

    Posted 22 days ago
    Hello Umair,

    Hope you are doing fine.

    Just wanted to know have you progress with that? I also trying to achieve the same functionality, but without success.

    ------------------------------
    Anton Karelin
    Jet Infosystems
    ------------------------------



  • 3.  RE: Sending custom values from a WebChat Widget using Extensions

    Posted 21 days ago

    Hello Anton,

    thanks - hope you are well!

    we were actually stumped in this solution with no clue so far!
    Raised a case with Genesys Care and the impression we are getting is that it has never worked before! Here is a recent response from the support: -

    "We are still under analysis together with our internal team and still looking for ways on how to pass the custom values"

    If you see my previous message, we have successfully managed to post static values from the custom extensions by calling:  WebChatService.setChatNotes function but once the web form is filled and the chat is loaded, this function doesn't work which aligns with the documentation in fact!

    Next we tried using "publish-subscribe" model on the Widget Bus to subscribe/publish events on the CXBus.
    Onbefore function was looking promising but we didn't succeed. Here is some documentation: -
    https://all.docs.genesys.com/WID/Current/SDK/GWCBusAPIOverview

    All in all, we are stuck for now



    ------------------------------
    Umair Khan
    ------------------------------



  • 4.  RE: Sending custom values from a WebChat Widget using Extensions

    GENESYS
    Posted 21 days ago
    Have you checked this: https://help.genesys.com/pureconnect/mergedProjects/wh_basl_connect/desktop/pureconnect_widget_extensions.htm or the related topic links in this help topic?

    ------------------------------
    Noreen Tasker
    Genesys - Employees
    ------------------------------



  • 5.  RE: Sending custom values from a WebChat Widget using Extensions

    Posted 21 days ago
    Hello Noreen,
    Thank you for your response,
    Yes, I've checked link you provided, but some things is not clear for me:

    WebChatService.setChatAdditionalAttributes

    This function takes in a dictionary of string/string pairs.  This function allows a custom extension to set additional Interaction Attributes on a PureConnect chat. This function must be called prior to a chat being started.

    What does it mean? Should I perform this command webchat ready? The only way I managed to get through parameters from registration form to CIC is via before("WebChatService.startChat") is it a proper way how it should work?







    ------------------------------
    Anton Karelin
    Jet Infosystems
    ------------------------------



  • 6.  RE: Sending custom values from a WebChat Widget using Extensions

    GENESYS
    Posted 20 days ago
    Edited by Noreen Tasker 20 days ago
    I am a technical writer.  I've referred your questions to a couple of developers.

    ------------------------------
    Noreen Tasker
    Genesys - Employees
    ------------------------------



  • 7.  RE: Sending custom values from a WebChat Widget using Extensions

    GENESYS
    Posted 20 days ago
    Hello Umair,

    You can do this by subscribing to WebChat.opened event then running the command setChatAdditionalAttributes. Here is an example:


    Note that the attrubute names will prefix with WebTools_ in the interaction. This makes the above WebTools_CustomChat and WebTools_Attribute2.



    ------------------------------
    Samantha Greatorex
    Genesys - Employees
    ------------------------------



  • 8.  RE: Sending custom values from a WebChat Widget using Extensions

    GENESYS
    Posted 20 days ago
    This should get what you need, depending on how you defined the "account" control:

    var service = CXBus.registerPlugin('MyCustomExtension');
     
    service.before('WebChatService.startChat', function (e) {
        service.command('WebChatService.setChatAdditionalAttributes', {
            account: e.userData.account
        });
    
        return e;
    });
    The name "account" is directly linked to the form control's name, which would have been set in the inputs array for the new form, for example this is how I defined the control on my web chat:
    {
        id: 'cx_webchat_form_account',
        name: 'account',
        maxLength: 100,
        placeholder: 'Account',
        label: 'Account'
    }


    ------------------------------
    Kevin Wiegand
    Senior Software Engineer
    Genesys - Employees
    ------------------------------



  • 9.  RE: Sending custom values from a WebChat Widget using Extensions

    Posted 18 days ago
    hi Kevin hi Samantha,

    Thanks for your response.
    I tried the setChatAdditionalAttributes command with some custom text set in the web chat form for account field. Where does it get received? Though, i also have a subject field on the form and it gets posted to the Chat Notes section  as depicts below (custom subject value). Am i supposed to see additional attributes under notes section as well?

    Here is how an interaction is answered by the agent but additional attributes doesn't seem to appear on agent's interface: -



    ------------------------------
    Umair Khan
    ------------------------------



  • 10.  RE: Sending custom values from a WebChat Widget using Extensions

    Posted 18 days ago
    Furthermore, I can see onbefore being called successfully and can manage to pick account number value as well following your advise



    ------------------------------
    Umair Khan
    ------------------------------



  • 11.  RE: Sending custom values from a WebChat Widget using Extensions

    Posted 17 days ago
    Hi Umair,

    According to support, this is a known issue and is being worked on.  They are expecting a solution very soon, I am also having this problem :)

    Here is the latest communication from support:
    "Just to keep you posted on this, this issue regarding custom field on widgets was originally raised as per CC-3349.  Also not sure if you have access or a way to view this but we have continued investigation with our Service Operations for SERVOPS-13055.  Investigations are still ongoing so far and we do not have yet ETA for resolution. Thank you for your patience."

    Best regards,



    ------------------------------
    Egill Palsson
    Advania Sverige AB
    ------------------------------



  • 12.  RE: Sending custom values from a WebChat Widget using Extensions

    Posted 17 days ago
    Thanks Egill. Good to know i am not alone waiting for a solution here :)

    Yes, i do have a case opened with support as well and it does seem the solution has been identified and is under testing. (from the most recent support update)

    This post was created a month ago even before creating the support case and got some helpful response from @Samantha Greatorex and @Kevin Wiegand last week. Trying to exhaust all the possibilities to get to the solution here

    Kind regards,
     ​​​​

    ------------------------------
    Umair Khan
    ------------------------------



  • 13.  RE: Sending custom values from a WebChat Widget using Extensions

    Posted 7 days ago
    Hi Umair,

    if you have the old WebTools correctly implemented, invoke the command like this:


    oMyPlugin.command("WebChatService.setChatAdditionalAttributes", {
      "XXXXX": "1234"
    });

    and it looks for in the CIC, in the interaction type Chat, a call attribute with the name "WebTools_XXXXX".

    But effectively, you can only use it BEFORE starting the interaction.

    Kind regards,
    Víctor T.

    ------------------------------
    Victor Tortosa Lopez
    Team Vision S. A.
    ------------------------------



  • 14.  RE: Sending custom values from a WebChat Widget using Extensions

    Posted 2 days ago
    Thanks Victor!
    it does seem to work with onbefore. I have also received detailed clarification on this solution from the team at Care that does make sense!

    On the other end, how does the validation works on the form fields. I wanted to hide form fields dynamically based on user selection on the form.
    For Example: If a user selects "Yes" from the drop down list (Existing Customer field) then show Account No text box and if the user selects "No" from the drop down list we hide Account No text box. (Is it doable? )
    There are examples available under Genesys Engage section though (not sure if those are even applicable on PureConnect). Following the documentation here: -
    https://docs.genesys.com/Documentation/GWC/Current/WidgetsAPI/CustCRF

    It seems the validate function is the way to go but using validate function makes the custom JSON invalid and it doesn't get parsed. Here is what i get on the configuration section under custom JSON field: -

    any thoughts?  Has anyone achieved something similar?


    ------------------------------
    Umair Khan
    ------------------------------