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 / User metadata for filt...
Power Apps
Answered

User metadata for filtering

(0) ShareShare
ReportReport
Posted on by 6

Hi all,

 

we are building an app where user has access to items in the list based on its 'metadata' from another list. A simplified model:

 

Sharepoint list 1 (Users): username, email, DEPARTMENT, ...

Sharepoint list 2 (Items): Item name, amount, DEPARTMENT

 

User can belong to more departments. In this case he will have more records in List 1.

We need to load her department/s into an array(?) and use these values in Filter formula.

 

Q1: Should we load department value into some global variable? There can be more than one.

Q2: I haven't found a way how to Filter() on more than one value, is is possible?

 

 

thanks a lot for answering these newbie questions!

 

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Here's a sample that uses multiple conditions in a FIlter()

    Filter(CustomGallerySample,"Lorem ipsum 1" in SampleHeading,"Lorem ipsum dolor sit" in SampleText)
  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @milosha ,

    What is the field type of department column? I assume it is Text, and you want to filter out all items belong to Department A and B.

    In general, we can use 'In' operator to filter by multi-value, such as Filter(Users, Department in ["Department A", "Department B"]), then the gallery will show all items belong to Department A and B. But there is a delegation warning, because 'In' operator is not delegable for SharePoint in PowerApps,

    If you want to avoid delegation warning, you can try this workaround, use ForAll function to iterate over the record of Table(["Department A", "Department B"]), collect each record that meets the '=' condition. 

    1. add a combo box to select departments, set items property: 

     

    Distinct(Users. Department)

     

    2. set OnChange property of combobox as below to store all records meet the filter condition to collection.

     

    Clear(MyCollection);ForAll(ComboBox1.SelectedItems,Collect(MyCollection,Filter(Users,Department = Result)))

     

    3. set Items property of gallery to MyCollection

    Snipaste_2020-01-08_17-12-53.png

    Sik

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 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard