cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
duckettj1
Frequent Visitor

filter a sharepoint datasource to only show user() details

I have a Sharepoint data source with Name, address, email and car reg details.

I want to be able to display this datasource in a table / gallery / view form - but only data relating to the signed in user - i've tried this code

 

Filter(HENG_VehicleInformation,'E-Mail' = (User().Email))

 

but i am getting delegation errors - presumably because my 'Users' table has more than 2000 users?  The datasource only currently has 2 records - but the potential to have 100's.

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

Save the Current user's email to a variable in the OnStart property for the App.  Then filter on that variable.  The delegation issue will go away.

Set(CurrentEmail, user().Email)

Filter(DataSource, 'E-Mail'=CurrentEmail)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User III
Dual Super User III

Save the Current user's email to a variable in the OnStart property for the App.  Then filter on that variable.  The delegation issue will go away.

Set(CurrentEmail, user().Email)

Filter(DataSource, 'E-Mail'=CurrentEmail)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Many thanks for your help, the delegation error has vanished! 

 

Need to know how to display the fields I need from the datasource, but i'll fathom it out, cheers.

Pstork1
Dual Super User III
Dual Super User III

Just add the filter statement to the Items property for the Gallery.  THen you can edit the fields to display the fields you want.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (57,962)