Migx where this and that!

Happy Friday all.

So, I’m trying to filter a migx TV output using tags. So What I want to show is all results where A = X OR Y.

I can easily filter by One or the other using:

&where=`{"A:=":"X"}`

But I want something like:

&where=`{"A:=":"X" OR "Y"}`

How should the syntax look? Or is this not possible?
I’ve tried various combos, but I can’t suss it.

Thanks in advance!

You probably have to use the in operator for this:

[[getImageList?
    ...
    &where=`{"A:in": ["X","Y"]}`
]]

Ah right OK - thanks - I’ll give it a whirl and report back!

Actually - I was coming at this at the wrong angle! (apologies!)

So, What I have is a list of people, who belong in teams.
I’m using Migx to call everyone in a team like so:

<h3>Team A</h3>
[[getImageList? 
            &tvname=`teamMembers`
            &where=`{"team:contains":"Team A"}`
            &tpl=`isotopeBioFilterTpl`
        ]]   

<h3>Team B</h3>
[[getImageList? 
            &tvname=`teamMembers`
            &where=`{"team:contains":"Team B"}`
            &tpl=`isotopeBioFilterTpl`
        ]]   

But I have a few people who belong to Team A and Team B.
So I changed my Migx input TV to listbox-multiple. This allows me to select more than one team per person.
I thought that was it - but as soon as I select more than one team for a person, The page loads as a blank white screen.

There seems to be a problem with “contains” in PHP 8 when “team” is an array (and not a string).

Try using find_in_set instead:

&where=`{"team:find_in_set":"Team A"}`

And Harry does it again!!! Thank you so much. Spot on!

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.