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 filter a field ...
Power Apps
Answered

How to filter a field with datatype table in Collection? (Using Sharepoint as database)

(0) ShareShare
ReportReport
Posted on by 1

Hi at all, 

 

I have the following goal to reach: 
1. Save data from a SharePointList with datatype Person/Role in a Collection 🆗
2. Save the Displayname of the currentUser in a variable 🆗
3. Filter the collection with the current username (Filter datatype table) 😭

4. show the username/ list of names in a dropdownfield

The SharePointList looks like this: 

ID          | MitarbeiterSharePoointAccount| Koordinator1SharePointAccount| Koordinator2SharePointAccount
Number| Person or Group                         |  Person or Group                        | Person or Group

situ_0-1651824678737.png


Case 1: The current user is a normal Employee
The Employee should only see his own data
Filter: _currentUser = Mitarbeiter SharePoint Account


Case 2: The current user is one of two Supervisor
The Supervisor can see his own data and the data of his Employees. 1 Employee can have up to two Suvervisor

I have tried the following: 
App OnStart
/*User*/
Set(_currentUser; User().FullName);;

ClearCollect(colMitarbeiterBR;ShowColumns(Mitarbeiter;"ID";"KoordinatorAccount";"Koordinator_2_SharePoint_Account";"MitarbeiterAccount"));;

situ_1-1651825331839.png

As you can see the SharePointAccount-Fields have the datatype table. 

If I try to filter those fields I get no results. I checked if the current user has an entry in SharePoint. I also checked the name. They should match. 

ClearCollect(colMitarbeiterB;Filter(Mitarbeiter;('Koordinator SharePoint Account'.DisplayName = _currentUser) Or ('Koordinator 2 SharePoint Account'.DisplayName = _currentUser) ));;

Has anyone an idea how to deal this problem? 


 

 

Categories:
I have the same question (0)
  • Verified answer
    v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @situ ,

     

     

    Do you want to filter the data based on the DisplayName field in the Person column?

    I have made a test for your reference.

     

    1. Here is my SharePoint list.

    vyujincuimsft_0-1652089000836.png

    2. Select the App and apply the following formula on its OnStart property as:

    Set(_currentUser, User().FullName);
    ClearCollect(colMitarbeiterBR,ShowColumns(BasicInfo,"ID","user","sales"));

    3. Select the Gallery and apply the following formula on its Items property as:

    Filter(colMitarbeiterBR,_currentUser=user.DisplayName)

    Result Screenshot:

    vyujincuimsft_1-1652089220426.png

     

     

    Best  Regards,
    Charlie Choi

     

     

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard