Using custom ticket fields and ticket forms with the Web Widget Follow

Comments

29 comments

  • Avatar
    Mikayla Welborn

    Do you plan to support conditional fields in the web widget? We'd love to enable ticket forms in the web widget but would need to use conditional fields as well--otherwise each form would show a lengthy list of all possible fields. Thanks!

  • Avatar
    Erica Wass

    @mikayla Thanks for writing! Yes, we are looking to explore how we might be able to add support for conditional fields in the Web Widget in the future. I don't have any current timelines for when or if this might be available, but it is something that we would update on this article.

  • Avatar
    Ed Ball

    It looks like the web widget does not support dynamic content for the custom field names. Playing with this in a sandbox setting and we use some dynamic content for field names so it changes in other languages. Does this really not work with the widget or is there something we need to change?

  • Avatar
    Erica Wass

    Hi @ed. That shouldn't be happening so I'm converting your note into a Support ticket. Thanks for letting us know it's appearing this way for you!

  • Avatar
    Will Sanderson

    I've had success customizing the web widget to show only the forms I want for a certain page, but I am also trying to get tags added to the web widget as well.  Whenever I add the "tags:" line, all ticket forms return.  Maybe my code is incorrect, but all attempts have failed.

    How can I achieve this?

    Here's the current code added below the standard widget script:

    <script type="text/javascript">
    window.zESettings = {
       webWidget: {
          contactForm: {
              tags: ['new_tag', 'next_new_tag']
                ticketForms: [
                    { id: ###### },
                    { id: ###### },
                    { id: ###### }
                ]
            }
        }
    };
    </script>

  • Avatar
    Niall Colfer

    Hi Will,

    Almost perfect! Looks like you're just missing a comma to make this valid JSON. You would need to include a comma after the tags array, before the ticketForms array, to separate them properly. So including just the important bits it would be:

    contactForm: {

      tags: [...],

      ticketForms: [...]

    }

    with the all important comma at the end of the second line.

    Hope this helps!

  • Avatar
    Will Sanderson

    Hey Niall,

    Thanks for the response.  Of course, I was missing that comma!  It now works perfectly.  Thanks for the quick help!!

    Will

  • Avatar
    Joana Crisostomo

    I'm on a Professional Plan and I don't have any option in Channel -> Widget to add Custom Ticket Fields to the Contact Form. Where can I activate this?

     

  • Avatar
    Nate Legakis

    I'm also having trouble finding the place to add custom ticket fields in a contact form. 

  • Avatar
    Joana Crisostomo

    @nate

    Have you checked if any of your custom fields are marked as visible to end-users and editable? That was my issue.

  • Avatar
    Nicole - Community Manager

    Thanks for sharing your solution, Joana! 

    Nate, let us know if that helps you out as well or if you have further questions. 

  • Avatar
    Mario Peralta

    Is it possible to prefill a Customer Custom Field? (ex: customer code or customer country). My customers are already loged in to an intranet, so i would like to capture customer code and counry automatically.

    What would be the approach to do this?

  • Avatar
    Daniel Aron

    Hi Mario, you can pre-fill a custom ticket field but if you are looking to pass in additional user information with zE.identify that is not currently possible. 

  • Avatar
    Stephan

    Hi, is it possible to pass additional information via Widget Form using hidden custom fields?

    We wanted to transfer additional information like Browser version etc. with the message, without presenting this data editable to the customers.

  • Avatar
    Daniel Aron

    Hi Stephan, the browser version and useragent is automatically on the ticket if you look at the events view: https://support.zendesk.com/hc/en-us/articles/203691176-Viewing-all-events-of-a-ticket

  • Avatar
    Stephan

    Hi Daniel, thank you very much for your quick response, although it does not quite answer the question. 

    We do process some thousand tickets a day, so going into "Events" is not an option for us unfortunately. Browser Version was also just an example and most of the data, we wanted to transfer, are not visible in the events view. 

    Is there anybody in the community, who managed this task to transfer additional hidden details within the ticket form, without making the data visible or editable to customers in some way ? 

  • Avatar
    Amy Wilkins

    Why can't the regular expression ticket field be used in the web widget?

  • Avatar
    Nicole - Community Manager

    Hi Amy - 

    It's not a request that comes up often, so it's simply not been something our product teams have prioritized implementing. That being said, I encourage you to post in the Product Feedback topic to voice your need for it. 

  • Avatar
    Paul Stokes

    Man I am really stumped. I am trying to prefill 2 custom fields and remove attachements in one fell swoop.

    What am I doing wrong? Any one of ther work by themselves but when I combine them the widget acts like there is no customization at all.

     

    <script type="text/javascript">
    zESettings = {
      webWidget: {
        contactForm: {
          fields: [
            { id: 80758268,  prefill: { '*': '14056' } }
          ]

          fields: [
            { id: 80758288,  prefill: { '*': '56565' } }
          ]

          attachments: false
        }
      }
    };
    </script>

  • Avatar
    Jessie - Community Manager

    Welcome to the Community, Paul!

    Let me see if I can find one of our Community Moderators to help you!

  • Avatar
    Anonymous (Edited )

    Hi @Paul,

    I think all you need is a proper formatting. Try this -

    zESettings = {
    "webWidget" : {
    "contactForm": [
    {
    "fields": [
    {
    "id": "80758268",
    "prefill": [{
    "*": "14056"
    }]
    },
    {
    "id": "80758288",
    "prefill": [{
    "*": "56565"
    }]
    }
    ]
    },
    {
    "attachments": "false"
    }
    ]
    }
    };

    A

  • Avatar
    Gaëtan Tobie-Echeverria

    hello,

    like Stephan we will need more infos and not in event, like the complete URL from where the client contact us.

    Thanks in advance for the solution

  • Avatar
    Michael Poijes

    Is it possible to pre-fill hidden ticket fields in the web widget? I want to pass some info about the page, where the web widget is, to the agent. But don't show it to the end-user as it will only confuse them. 

  • Avatar
    Jessie - Community Manager

    Hey Gaëtan!

    Can you tell me what information you need? Whether or not it's possible will depend on what you're looking for, most likely.

  • Avatar
    Jessie - Community Manager

    Hi Michael! 

    I'm not sure whether this is possible, but let me see what I can find out for you. :)

  • Avatar
    Gaëtan Tobie-Echeverria

    hi Jessie,

    I'd like to have the URL where the user is when he contacts us through the widget. The widget is deployed on all my site which contains 1K+ pages. And I don't want to add a custom field and ask the end-user to paste the url in it. It should be automatic and in the background to avoid bothering end user and to help the investigation by support team who'll received the ticket.

    regards

  • Avatar
    James Sanford

    Hey Gaëtan!

    As outlined in Adding custom tags to Web Widget tickets from specific pages "All tickets submitted through the Web Widget include the URL for the page the user was on when the ticket was sent."  What you are requesting is already the default functionality for Web Widget behavior.

    If you're looking for additional information about your customer's navigation I recommend the Pathfinder App (available with Support Enterprise or via the Productivity Pack Add-On).

    If you wish to set custom field values without exposing that to the customer you will have the best results with drop-down (tagger) fields as you can use the Web Widget API tags function to add a tag to the ticket created via the Web Widget.  Since drop-down field values correspond to their tag value, if you pass a tag that matches a field value this will in turn set the value of the field itself.  

  • Avatar
    Gaëtan Tobie-Echeverria

    hello James.

    my mistake. Indeed the link is at the bottom of the ticket so it works for us. I'll build dedicated automatism

    best regards

  • Avatar
    Stanislav Suvorov

    Is there any way to add a custom field that is hidden or disabled for editing?

    I am trying to send additional data such as user id, that is very useful for ticket solving, but i can only add a field that is open for editing, so it is nto that great for that kind of data.

Please sign in to leave a comment.

Powered by Zendesk