Legacy Knowledge Base
Published Jul. 2, 2025

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

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

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.

Environment

  • DXP 7.2
  • DXP 7.3

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.

Additional Information

  • A feature request for more robust logic in Segments which allows for the inclusion of both AND and OR variables has been created, and its progress can be followed at LPS-122717. Voting for this feature request will increase its visibility.
  • How to create User Segments
Did this article resolve your issue ?

Legacy Knowledge Base