Skip to main content
Contributor
June 4, 2020

Technical Note: [FortiSOAR / Cybersponse Tricks'n'Tips] Remove duplicate items from a list

  • June 4, 2020
  • 0 replies
  • 984 views
Description

There might be cases where you might want to remove duplicate items from a list, running 2 different searches concurrently, but the combined search results have duplicate IDs of records. Normally, in Python, you would cast this list to a set to get rid of the duplicates but Jinja does not have a "set" function.

However, you can easily get rid of duplicate items in a list by using the "unique" filter.

  

{{my_list|unique}}