List filter - comparison operator for boolean values

I’m trying to accomplish the following behavior:

isExplicit = 1 & allowExplicit = 1 → allowContent = 1
isExplicit = 0 & allowExplicit = 1 → allowContent = 1
isExplicit = 1 & allowExplicit = 0 → allowContent = 0
isExplicit = 0 & allowExplicit = 0 → allowContent = 1

Typically, I would approach this as isExplicit <= allowExplicit, but <= isn’t a supported comparison operator for boolean (yes/no) values in the do a search filter.

Should I just make these both numbers instead of boolean values or is there a smarter way to do this keeping the boolean type?

Actually, I only see one condition that doesn’t allow content. So I think you can just filter using is explicit is yes (or 1) and allow explicit is no (or 0), not allow content.

Thanks @Jici , but I’m still not seeing a clear way to accomplish this in a list filter - even with Advanced filter? Any thoughts?

For more clarification, I’m filtering a list of content. isExplicit is a field in the content and allowExplicit is a field in the user. allowContent was just a placeholder - not a real variable / field anywhere in the application.

Are both a True/False (yes/no) fields?

Yes, both are True/False (yes/no).

I guess that you are currently displaying the list using a RG. So I suggest you to set a conditionnal is current user allowexplicit is yes.
In this conditionnal, the data source will be Do a search for Content (no filter)
The original data source will be Do a search for, filter isExplicit = No
So this way, initially the RG will load no explicit content, but base on user allowContent, you will load all content if allow explicit

Hey @Jici - this is actually not a repeating group. A single piece of content is pulled from the filtered list using :random.

I think I’ll give the number approach a try, but it’s unfortunate there isn’t a cleaner way to do this.

You can use the :random after both source. In your case, this will depend on how you set data you are getting. But the main thing is to have one conditionnal to also get explicit if this is allowed

This topic was automatically closed after 70 days. New replies are no longer allowed.