Workarounds: Add ability to search custom field text in Trigger


  • Alejandro Colon

    Here is the conversation as it stands. 


    Hello Alejandro,

    What specifically do you mean with search? I change the user language in the users account depending on one or more choices in a multiple choice input field given by a contact form. If that is near what you search let me know.

    Alejandro Colon



    I will give you my specific use case but it is very niche and will not necessarily apply to others.

    In my business, we would like the ability for a user to designate the organization they are submitting a request for.
    The issue with this is that the Web Widget does not allow a registered user to select the organization like the HC form does.
    Therefore, we would need to set a custom field that would allow a user enter in the organization.
    For most of our customers, we are legally unable to post that they are our customer.
    So, what I would like the ability to do would be to search the custom field using a trigger and setting the organization.
    Currently, my agents have to read the custom field and then manually change the organization as the web widget automatically chooses one.
    That being said, there are many use cases where I would like the ability to search the text inserted into a custom field with a trigger.


    How many organizations do you have? If it's limited then you could use a custom ticket field that lists the options. You could check the options in liquid then and update the organization_id of the end user via misusing the http target extension from zendesk to access the zendesk api.

    If you want you can also use a simple text input field and check the content with liquid. But customers would need to write it in correctly all the time which probably won't happen.

    I did not try it but maybe I miss your problem. Of course it also might be that it doesn't work but that's how I would approach it.

  • Alejandro Colon


    We do not have too many organizations but the issue with listing them as you suggest is that we are legally bound not to disclose them as our customers. Therefore I cannot use your first suggestion. 


    I do not mind using the target extension to update the Zendesk API from Zendesk. I use that for other updates as well. 


    I am most interested in your idea to use a simple text input field and checking the content with liquid. 

    Obviously, that would mean they would have to put it in correctly but skirting that for the moment, I am interested in how you would accomplish this. 

  • Sebastian

    Hi Alejandro,

    Honestly, I don't think you will be lucky with zendesk including that. There are other easier implementations waiting since years. Might be there will never come something like that.

    I show you on the user language.

    The trigger sends the json like this to the http target:

    "user": {
    "locale": "{{dc.check_preferred-language_chosen_give_lang-code}}"

    The dc element ist like this:

    {% if ticket.ticket_field_360000267739 contains 'magyar' %}{% assign lang='hu' %}{% endif %}{% if ticket.ticket_field_360000267739 contains 'español' %}{% assign lang='es' %}{% endif %}{% if ticket.ticket_field_360000267739 contains 'français' %}{% assign lang='fr' %}{% endif %}{% if ticket.ticket_field_360000267739 contains 'türkçe' %}{% assign lang='tr' %}{% endif %}{% if ticket.ticket_field_360000267739 contains 'deutsch' %}{% assign lang='de' %}{% endif %}{% if ticket.ticket_field_360000267739 contains 'english' %}{% assign lang='en' %}{% endif %}{{lang}}

    The ticket field is a multiselect dropdown but it stores the chosen values somewhat as a text, as far as I remember correctly.

    So a text input field should work the same.

    Not sure if "contains" is case sensitive but you should be able to use "downcase" to at least only have to compare lower case text, regardless of what the user types into.
    And you need to figure out which combinations the user could give you.
    "Product 1" and "product 1" would be the same downcase in any case at least. But "product1" or "prod 1" and whatever they could give would be up for you guessing. Or you might check the data you already have and collect all variants.

    Most important is a test function with a test account. As easy as possible as proof of concept that you can change the id of the organization. Then move on from there since zendesk really does not provide any error messages that could help you.

  • Judy Huynh

    Found this article as a good work around for this use case in the meantime-


Please sign in to leave a comment.

Powered by Zendesk