My custom module has a text input. If I input “Sales; Marketing” I should return both rows. If I input “Support” I should only return the first row.
I’m able to turn the inputted string into a list such as [Sales, Marketing] and I can do the same for my table rows (so I get [Marketing, Support] and [Sales]).
I am hoping to then be able to take the intersection of my inputted list and my video tag list, and if the length of that list is > 0, then I show the video.
How I was hoping to do it:
In jinja, I would do this by a conditional statement that looks like this:
{% if (video_tag_list|intersect(inputted_tag_list))|length > 0 %}
It looks like you could use a multiselect column type for your tags. Then you could use a contains filter to match rows that contains at least one of the tags.
An intersect filter would help, but it looks like that’s a filter proprietary to SaltStack’s Jinja and not part of the core project. In any case, the query filter is faster.