
Announcements
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
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"));;
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?
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.
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:
Best Regards,
Charlie Choi