Can I hide the department field on the pre-chat form?

Return to top
Have more questions? Submit a request

17 Comments

  • Kristin Z.

    Hi,

    Is it possible to find the ID of a department so that we dont need to use the string of the name in our code? Sometimes we change the department name but want to ensure we dont need to update the code every time this happens.

    I went to the chat dashboard and went to "Departments" and only saw the names of departments, but no IDs.

    Any help would be great, as every article I click on seems to lead me to another article and another... :)

    - Kristin

    0
  • Brett Bowser
    Zendesk Community Team

    Hi Kristin,

    If you have a standalone Chat account you should be able to get the department ID by first logging into your dashboard then navigating to zopim.com/api/v2/departments.

    However, if you have an integrated Chat account with Support things get a little trickier here. You would need to use the following instructions to generate an OAuth token for your integrated Chat account so you can pull this information from the API: Chat API tutorial: Generating an OAuth token (integrated Chat accounts)

    Hope this information helps!

    0
  • Kristin Z.

    Brett,

    We are already using the API and we found what we were looking for with that, thank you for pointing me in the right direction! :)

    0
  • Brett Bowser
    Zendesk Community Team

    Happy to help Kristin :)

    0
  • Kiva Bostrom

    Is it possible to remove a field? In our case, we would like to remove the phone number from one of our websites chat, but the form itself is a shared form, so we want to keep the field in place. If we cant remove it, can we hide it? Our attempts at using common jQuery or JavaScript methods are failing. Thanks!

    0
  • Erika Camille Sundian
    Zendesk Community Team

    Hello Kiva Bostrom,

    I consulted our Product Engineers and was advised that hiding the name and email or phone fields is only possible by disabling the entire pre-chat form. It is not possible to selectively hide just those two fields with Chat admin settings, the Javascript API, nor with even my backend tools.
     
    We can't find any workaround to suggest at the moment so I'll also leave this post open in case other users have a solutions for you :)
    0
  • Andrew

    We would also like to request the ability to remove the department field (and more generally, be able to customize this form to add other custom fields). After working with your support team, the code snippet is not working for us and we do not have engineering resources to tap into to investigate.

    0
  • Marcela Arango

    Hi I understand that the API solution will apply for the chat widged that customers see in external pages. How about changing the prechat form for the chat window in my Zendesk helpdesk? 

    How could I do that? Thanks for your help

    0
  • Elissa
    Zendesk Community Team

    Hello Andrew and Marcela Arango,

    The only native functionality that removes the department dropdown from the pre-chat form is to turn off all your departments. Beyond that it does unfortunately require the use of API and custom coding.

    The pre-chat form is quite hard coded and it is not possible to add custom fields either.

    That being said, you can customize all of the fields and even have multiple forms available to visitors if you use the Web Widget. It's not a perfect solution of course because the Web Widget presents forms as a way to make a ticket, rather than before a chat is started. 

    Finally, Marcela Arango, if you're looking to use the API coding mentioned in this article in your Zendesk Guide Help Center instead of your own webpage, you can use these directions to help: How do I customize the Web Widget in my Help Center using APIs?

    I'm sorry I don't have better solutions! I hope that helps a bit!

    1
  • Marcela Arango

    Thanks! 

    0
  • Francois S

    Hi,

     

    Its clear how to do that with the API, but how does we do it when the web widget is available on the help center? 

     

     

    0
  • Elissa
    Zendesk Community Team

    Hello Francois S

    You actually can use the same API code to customize your Web Widget in your Guide Help Center as well. You'll simply put the code into your Help Center Theme as outlined in this article: How do I customize the Web Widget in my Help Center using APIs?

    I hope that helps. Let me know if you have further questions on that!

    0
  • Marcela Arango

    Great! I managed to do it that way. Thanks!

    0
  • Brad Taylor

    i've run the code and it seems to do nothing. do I need to do anything else?

     

     

     

    I've tested API access and can make tickets so when running 

    window.zESettings = {
        webWidget: {
          chat: {
            departments: {
              enabled: []
            }
          }
        }
      };

    just gives me some

    {webWidget: {…}}webWidget: {chat: {…}}__proto__: Object

    when i go to check if the dept box is gone from selection its still there with the 2 depts we have

    0
  • Thomas Verschoren
    Community Moderator

    It's a two step process:

    You need to set the enabled list to the one item and select one item:

    <script type="text/javascript">
      window.zESettings = {
        webWidget: {
          chat: {
            departments: {
              enabled: ['hr'],
              select: 'hr'
            }
          }
        }
      };
    </script>

     

    0
  • Brad Taylor

    wouldn't that just default to hr? we're trying to hide it entirely like this picture

     

    https://support.zendesk.com/hc/en-us/articles/360022184994?page=1#comment_360004897033

     

    and then have triggers on chat route to departments

    0
  • Elissa
    Zendesk Community Team

    Hello Team,

    Closing the loop here. Brad and I were able to get this sorted out in a ticket. I've made updates to the article to be more clear on where to put the code (right in with your widget script that you've added to your website) and to be more clear that leaving it all blank does in fact make the Department dropdown completely disappear, not just uneditable.

    I hope that all helps! Let us know if anyone has lingering questions.

    0

Please sign in to leave a comment.

Powered by Zendesk