Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Filter Query: Multiple Conditions - and / or

(1) ShareShare
ReportReport
Posted on by 98

Hello everyone,


I would have to write an expression that filters active users. Additionally, the user type should be "Guest" or have a specific name in the domain.
I can't get the "or" statement, including the active user expression

 

Currently my expression looks like this. Unfortunately, either guestuser or with the specific domain are output, but not both together. I have tried different expression configurations, the current one is wrong but it works

 

 

and(
 equals(item()?['AccountEnabled'],true),
 equals(item()?['UserType'], 'Guest'),
 not(endswith(item()?['UserPrincipalName'], '@example.com'))
)

 

 

 

 i also try this one:

 

 

and(
 equals(item()?['AccountEnabled'],true),
 endswith(item()?['UserPrincipalName'], '@example')
)
or(
	equals(item()?['AccountEnabled'],true),
 equals(item()?['UserType'], 'guest')
)

 

 

 

or this:

 

 

equals(item(?['AccountEnabled'], true)) and (endswith(item()?['UserPrincipalName'], '@example')), or (equals(item()?['UserType'], 'Guest'))

 

 

 

About Help I would be happy

 

Regards

  • vipfafen Profile Picture
    98 on at
    Re: Filter Query: Multiple Conditions - and / or

    Hi all, 

     

    Found an error, it was my fault. The value "UserType" was missing in the Http request... so it couldn't be read. Seems to be working now

     

    thank you guys

    Regards

  • Sayan Profile Picture
    711 Super User 2025 Season 1 on at
    Re: Filter Query: Multiple Conditions - and / or

    Hey @vipfafen 

     

    Can you please share the Workflow?

     

    Thanks,

    Sayan Patra | RPA Developer

  • vipfafen Profile Picture
    98 on at
    Re: Filter Query: Multiple Conditions - and / or

    Hi @Shravan

     

    thank you for your replay. 

     

    Unfortunately the same issue. Either guest user or with a specific domain, but not both.

    vipfafen_2-1721025977601.png

     

     

     

    Regards

  • Verified answer
    Shravan Profile Picture
    128 on at
    Re: Filter Query: Multiple Conditions - and / or

    Hi,

     

    Try This :

    and(
    equals(item()?['AccountEnabled'], true),
    or(
    equals(item()?['UserType'], 'Guest'),
    endswith(item()?['UserPrincipalName'], '@example.com')
    )
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >