web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : PAQtgKWXpff51zZryva1Uj
Power Automate - Building Flows
Answered

Filter Query: Multiple Conditions - and / or

Like (1) ShareShare
ReportReport
Posted on 14 Jul 2024 22:56:58 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 15 Jul 2024 at 09:00:49
    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
    789 Super User 2025 Season 2 on 15 Jul 2024 at 08:15:34
    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 15 Jul 2024 at 06:19:43
    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 15 Jul 2024 at 02:38:47
    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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2