cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shaneOZ
Responsive Resident
Responsive Resident

Large Sharepoint Online List, Best practice to filter gallery by current Office365 user or use a different way

Hi,

 

I have a rather large SharePoint online list that users need access to view their latest list items, however the list has some sensitive list items that i do not wish for other users to see anyone elses,

 

The app is the fairly standard 3 screen model app created through sharepoint.

 

Previously on apps ive built the gallery would on load briefly show everyones and all the latest entries until the filter would "kick in" and apply only showing the current user.

 

Is this the best practice code to filter the gallery on the homescreen

 

Set(clearVar, "");Set(gvarUserEmail, User().Email);Set(varDateDiff, DateAdd(Today(), -31, Days));ClearCollect(  
              RecordsCollection, 
              Expenses           
);Set(CurrentUser, User()); Set(CurrentUserEmail, Lower(User().Email))

 

 

Am i best somehow collecting the data on the startup?

 

this app also needs to be offline so how do i edit the collection and keep the changes applied until connection.connected? whilst showing the user on next load etc?

 

Could someone help me with this problem.

4 REPLIES 4
v-siky-msft
Community Support
Community Support

Hi @shaneOZ ,

 

From the given information, the codes in OnStart property looks reasonable. What is the Items property of Gallery? That is, Is there anything wrong with the gallery?

 

If you want to achieve offline capabilities, I recommend you read this blog, it provides a detailed example of building these offline capabilities, you can learn from it.

If you have any question on it, please feel free to post back.

Sik

 

shaneOZ
Responsive Resident
Responsive Resident


@v-siky-msft wrote:

Hi @shaneOZ ,

 

From the given information, the codes in OnStart property looks reasonable. What is the Items property of Gallery? That is, Is there anything wrong with the gallery?

 

If you want to achieve offline capabilities, I recommend you read this blog, it provides a detailed example of building these offline capabilities, you can learn from it.

If you have any question on it, please feel free to post back.

Sik

 


Its more the code displays everyones data at the start of the app for a brief second. Is there someway to include the code in the Onstart part of the app so the gallery only displays the current user the entire time?

@shaneOZ 

A very simple quick fix might be to just add a blank landing screen with a timer on it and a Loading Spinner GIF. Then, OnTimerEnd --> Navigate to gallery. Set the Timer duration to what suits your load time?

Hi @shaneOZ ,

OK, how did you define the Gallery.Items property

I doesn't suggest you save the filtered SharePoint list to Collection at startup if your SP list has more than 2000 records, since the clearcollect isn't delegable, it can only get 2000 (maximum) records from the list.

 

As an alternative workaround, please try to modify the Gallery.items property as follows to see if the issue is fixed.

If(!IsBlank(gvarUserEmail), Filter('SP list', ColumnName=gvarUserEmail))

Sik

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (81,695)