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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter Query: Multiple...
Power Automate
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

Categories:
I have the same question (0)
  • Verified answer
    Shravan Profile Picture
    128 on at

    Hi,

     

    Try This :

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

  • vipfafen Profile Picture
    98 on at

    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

  • Sayan Profile Picture
    818 Moderator on at

    Hey @vipfafen 

     

    Can you please share the Workflow?

     

    Thanks,

    Sayan Patra | RPA Developer

  • vipfafen Profile Picture
    98 on at

    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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard