Skip to main content
Solved

Limit dropdown choices by company segment


Kaley White
Contributor
Forum|alt.badge.img+7

Is there a way to hide dropdown choices in a ticket field based on the requestor’s company segment? In our ticket form, we have a Type field that determines which sections are shown. Only our Distributors company segment should be able to select the New license option.

 

Best answer by aravind.sundararajan

Hello @Kaley White,

 

It is possible to customize the portal form to show/hide field values based on the user attributes. Though it is not possible to leverage the company segments for this purpose, we can use other user attributes (name, email, company name, custom attributes, etc.) to conditionalize the field values. Here’s a sample code to get you started:

 

{% if portal.user.company_name == "Acme Inc." %}
  jQuery(document).ready(function(){
  jQuery('#helpdesk_ticket_ticket_type option[value="Incident"]').remove();
  });

 {% endif %}
</script>

 

Cheers!

View original
Did this topic help you find an answer to your question?

4 replies

eeha0120
Skilled Expert
Forum|alt.badge.img+12
  • Skilled Expert
  • 752 replies
  • October 23, 2023

Hi.

There’s a feature called Dynamic forms which should help for that:

Creating dynamic sections : Freshdesk

Please note this is available only from Pro/Estate plans.

 

Hope this helps.

 

Regards,


eeha0120
Skilled Expert
Forum|alt.badge.img+12
  • Skilled Expert
  • 752 replies
  • October 23, 2023

Hi.

Just double checking your screenshot, it seems you’re already using them.

Currently, AFAIK, there’s no such filter in FreshDesk. There’s a feature called Business Rules for Forms, valid in FreshService that suits this need, but I haven’t found if a complete analog exists in FreshDesk.

You might try to check with support.

 

Regards;


Kaley White
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • 21 replies
  • October 24, 2023

Thanks @eeha0120. Support says that this requires portal customization by Freshworks developers. :( I tried editing my portal theme, but according to the developers forum, there doesn’t appear to be a way to edit the new_ticket_form snippet.

 


aravind.sundararajan
Skilled Expert
Forum|alt.badge.img+12

Hello @Kaley White,

 

It is possible to customize the portal form to show/hide field values based on the user attributes. Though it is not possible to leverage the company segments for this purpose, we can use other user attributes (name, email, company name, custom attributes, etc.) to conditionalize the field values. Here’s a sample code to get you started:

 

{% if portal.user.company_name == "Acme Inc." %}
  jQuery(document).ready(function(){
  jQuery('#helpdesk_ticket_ticket_type option[value="Incident"]').remove();
  });

 {% endif %}
</script>

 

Cheers!


Reply