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 Apps / How to use Or operator...
Power Apps
Answered

How to use Or operator in filtering

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, i need to use the or operator in this case...

 

I have a SP list with 4 column.

Regionold; regionold2; regionold3; region

 

Region is like a state. I need to filter the user region actually in use with the new region. 

For that, 

 

1. I Check the region of the user with office365user

2- if he lives in regionold, print the value in region; if he lives in region2 print region, if he lives in region3 print region.

 

To test that i add a combobow with this formula

 

'Utilisateursd''Office365'.SearchUser({searchTerm:ComboBox1.SearchText;top:100}).Mail

 

then i add a dropdown control and i add ths formula

 

Filter(Base_region_centre_update; Region_Old Or Region_Old2 Or Region_Old3='Utilisateursd''Office365'.UserProfileV2(ComboBox1.Selected.Mail).companyName).Region

 

but it's not working. If i tried to filter with only Region_old it's working. 

 

My sp looks like this

 

ALP1_0-1633352231975.png

 

the attribut compagnyname is where are stored the user region in our AAD

 

I use this formula to check this

 

'Utilisateursd''Office365'.UserProfileV2(ComboBox1.Selected.Mail).companyName

 

 

 

Can you help me. What am i missing ?

Thanks

 

 

Categories:
  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    Each condition in the filter needs to return true or false  on its own - a column name alone does not do that. Try this version, using a With() to avoid a lot of repetition of code:

    With({ aRegion: 'Utilisateursd''Office365'.UserProfileV2(ComboBox1.Selected.Mail).companyName.Region};
    Filter(Base_region_centre_update; aRegion = Region_Old || aRegion = Region_Old2 || aRegion = Region_Old3 || aRegion = Region)
    )

    I prefer to use the || notation to denote OR. This filter returns any records that have the user's region in any of those four columns. I wasn't sure how that fit into the dropdown or combobox you mentioned, but this should get you started.

     

    Bryan

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Wahouu i'm so impressed. I didn't knew With function. It's powerful. I watched a video from shane young to learn more.

     

    I modified the formula like this

     

    With({aRegion:'Utilisateursd''Office365'.UserProfileV2(ComboBox1.Selected.Mail).companyName};Filter(Base_region_centre_update;aRegion=Region_Old||aRegion=Region_Old2||aRegion=Region_Old3||aRegion=Region))

     

    You forgot to remove .region after compagnyname.

    It works like a charm. Thank a lot

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard