0 Replies Latest reply on Dec 13, 2016 8:43 PM by kimt15500961

    Liquid - Display list of results minus duplicates

    kimt15500961

      Hi,

       

      I have a string field called Industry where people will be entering in their Industries. e.g. Agriculture, Manufacturing, IT, Landscaping etc.

       

      I would like to output this data using liquid however, I want to place it into an Web App Search form within a dropdown menu so users can search for the particular field. Therefore I would not like to add any items that are duplicates.

       

      E.g. entries from users include: Agriculture, Manufacturing, Agriculture, IT, Landscaping, Agriculture - you can see Agriculture is used 3 times. If i use the below it will be listed 3 times:

       

      <select>

      {module_webapps id="12345" collection="industry" filter="all" template=""}
      {% for item in industry.items %}

           <option value="{{item.industry}}">{{item.industry}}</option>

      {% endfor %}

      </select>

       

      How do I use a loop or an array to only display the industry once and hide all other duplicates?

       

      Thanks