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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to filter a field ...
Power Apps
Unanswered

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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard