
Announcements
Hi i have created a gallery in powerapp and im trying to give user a view based on admin and normal user so my app goes like this Admin will create a project say name Project1 -> test -> files so this is the hierarchy of the files admin will create and i have given admin view by creating 3 galleries, gallery1 - which will show Project1 and so on and I wanted admins to see only the projects they have created my formula for
gallery1 - Filter(Documents, 'Created By'.Email = TextInput3.Text && IsFolder && 'Folder path'="Shared Documents/")
gallery2 - Filter(Documents,'Folder path' =Gallery1.Selected.'Full Path'&"/" )
gallery3 - Filter(Documents,'Folder path' =Gallery2.Selected.'Full Path'&"/" && !(IsFolder))
All i want to do is give normal user the view inside the test folder and the files created by the respective user
Hi @Anonymous ,
Do you want:
1)admin could view three galleries and gallery1 for Project folder names, gallery2 for test folder names, gallery3 for file names?
2)common user could only view respective file names?
If so, I suggest you filter based on 'Folder path' field.
Try this:
1)gallery1's Items:
Filter(Documents,
'Created By'.Email = User().Email &&
IsFolder &&
'Folder path'="Shared Documents/")
gallery1's Visible:
If(User().Email in [adminemail1adminemail2,adminemail3],
true,false)
//please fill in admin emails in [adminemail1adminemail2,adminemail3]
2)gallery2's Items:
Filter(Documents,
'Created By'.Email = User().Email &&
IsFolder &&
'Folder path' =Gallery1.Selected.'Full Path'&"/"
)
gallery2's Visible:
If(User().Email in [adminemail1adminemail2,adminemail3],
true,false)
//please fill in admin emails in [adminemail1adminemail2,adminemail3]
//then gallery 2 will display folders based on gallery1. Gallery1 and gallery2 will only be visible when current user is admin.
Gallery1 and gallery2 will filter based on current user.
3)gallery3's Items:
Filter(Documents,!(IsFolder),
'Created By'.Email = User().Email
)
gallery3's Visible:
If(User().Email in [adminemail1adminemail2,adminemail3],
false,true)
//please fill in admin emails in [adminemail1adminemail2,adminemail3]
Then gallery3 will only display current user's files. Gallery3 will only be visible when current user is not admin.
Best regards,