How Can I Include Both AND and OR Variables in User Segments?
written-by
Madeleine Clay
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
legacy-article
learn-legacy-article-disclaimer-text
Issue
- I would like to create User Segments which include some roles and exclude others. For example, I would like a segment which includes either roles X or Y, but not roles A, B or C. In order to do this, I need to be able to set both AND and OR variables in the same segment.
Resolution
- Currently, AND/OR variables are tied so that all the variables in Segments must be set either to AND or to OR, rather than any combination of the two
- This is intentional behavior based on LPS-95669, because multiple interpretations of AND/OR combinations are possible, for example
(role A AND role B) OR role C has a different meaning than role A AND (role B OR role C), and there is currently no way to differentiate these interpretations in Segments.
did-this-article-resolve-your-issue