When you're building pages that display data to users, duplicates are the enemy of clarity. Whether you're showing a list of assignees, departments, or alert types, repeated values make your interface look messy and unprofessional. They also confuse users who might wonder if the duplicate means something different.
UNIQ is your cleanup function. It takes an array and removes any duplicate elements, leaving you with a clean list where each value appears exactly once.
Basic syntax
UNIQ(array)That's it! UNIQ takes one argument; the array or path to the array you want to deduplicate. It returns a new array with duplicates removed.
UNIQ example: Department cleanup
Let's say you've collected user responses from a page form, and multiple people wrote down the same department, making your "departments" array after all of their submissions look like this:
["Engineering", "Sales", "Engineering", "Marketing", "Sales", "Engineering"]You want to display a list of unique departments that were selected. Here's how you'd use UNIQ:
UNIQ(action_name.departments)The output:
["Engineering", "Sales", "Marketing"]UNIQ removed the duplicate entries, leaving you with a clean list of the three unique departments. The order is preserved based on the first occurrence of each value.