How to hide dropdown field value in the request form for End User ?



image avatar

Renaud Croix

Most Engaged Newbie of the Year - 2021

2021년 11월 25일에 게시됨

Hello,

I would like to hide a specific dropdown field value in the request form for End User ?

How to proceed ?

 

Thank you


9

28

댓글 28개

      Hi Sanskar,
       
      It looks like you're looking to create conditional ticket fields. You can create a ticket field that's dependent on another ticket field's options/response. The options available for your end-user or customer will be dependent on what they choose or select for the value on a different field.  
       
      We have a full guide that you can use for reference: Creating conditional ticket fields

      I hope that helps!
       

      0


      Hello!
      Is there any way, by which we can make dynamic dependent forms on zendesk? 
      To explain my use case better,
      Suppose there are two custom fields of tagger type. Now, if I select an option in the first custom field, the second custom field shows/updates options corresponding to the option selected in the first field.

      0


      Hi Alfredo Navarro

      Thanks for helping and providing the code. 

      I was wrecking my brain trying to get this to work before I stumbled onto your code. 

      For anyone coming along now just to be clear here's what I done to get it working. 

      In the script.js file of my theme go to the bottom of the page and add. 

      // For this funtion to work i needed to call it in my script.js file first.
        $(document).ready(function() {
          hideDemoOptionForAnonymous();
        });

      // This will hide the option with the id demo_field if the user is anonymous.
      function hideDemoOptionForAnonymous() {
        if (HelpCenter.user.role === "anonymous") {
          Array.prototype.forEach.call(document.querySelectorAll(".nesty-panel"), function(tagsElement) {
            if (tagsElement !== null) {
              var fieldDisableTagsObserver = new MutationObserver(function(mutations) {
                mutations.forEach(function(mutation) {
                  if (mutation.type == 'childList') {
                    if (mutation.addedNodes.length >= 1) {
                      for (var i = 0; i < mutation.addedNodes.length; i++) {
                      var demoFieldToRemove = document.querySelector("li#standard_request");
                        if (demoFieldToRemove !== null) {
                          demoFieldToRemove.remove();
                        }
                      }
                    }
                  }
                });
              });
              fieldDisableTagsObserver.observe(tagsElement, {childList: true});
            }
          });
        }
      }

      Another thing to note:

      In order to find the option id's you need to enable emulate a focused page in the console, you can google this or

      open console in chrome

      click the three dots top right

      more tools - rendering

      click on emulate a focused page

      once you turn on emulate you can open the dropdown and it will stay open so you can hoover over the options and read the id. 

      example: you can see the id for this option is standard_request.

      0


      Hello Dustin Swayne,

      I have not tried it with the latest version of the Copenhagen theme. We have our own custom one based actually on a previous version and we did not upgrade since there were not many features. I will give it a try anyway to see if it still works (although it should be if the structure of drop-down options did not change).

      Best regards, Alfredo

      0


      Alfredo Navarro is the code for hiding a dropdown value still working for you in V2 of copenhagen?

       

      0


      Hi Alfredo,

      That's good news, With basic coding skills I managed to build the homepage, but just trying out to customize the visibility. I really appreciate your time, thank you for all your help and guidance.:) 

      0


      Hello Johnny,

      OK, I understand. Basically you should be able to control the visibility of tiles based on the role of the user, but definitely you need to code this in the templates of the custom theme to either show a tile or not. This is definitely possible but it requires a bit of knowledge in the development of the custom theme.

      Thanks and best regards, Alfredo

      0


      Hi Alfredo,

      Apologies if I wasn't clear enough, I mean the visibility of the entire help center must be different for internal end users and for external end users.

      We have built a tiled layout homepage (Tile 1 - Service Requests, Tile 2- Report an issue, Tile  3 - A cloud based platform (for both our internal end users and external end users).

      Both the users will access the same help center URL, but external end users must only see one tile (Tile - 3) as other tiles would be not relevant to them. Is this possible?

      Thanks,

      0


      Hi Johnny,

      Not a problem, happy to help. Regarding your other question, basically you can define the visibility to articles (and sections I think), then you  can define those that are internal for agents only, the others for end-users. I think that it should be possible and you can do a bit customization in the home page to make it look nice :-). The URL of your help center is always fixed, so I really think that the only way is via these permissions.

      Best regards, Alfredo

      0


      Hi Alfredo,

      Thank you again, yes,  I will surely try this and I will let you know. I also have another question, hope you can help. Is there a way we can we direct users to two different interfaces but with the same help center URL?

      For example, internal users visits our helpcenter and only elements that are relevant to them are shown. Likewise, for external users, the user visits the same helpcenter url, and only elements specific to them are visible. Is this possible? 

      Thanks in advance,

      0


      댓글을 남기려면 로그인하세요.

      원하는 정보를 못 찾으셨나요?

      새 게시물