cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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 @Anonymous ,

 

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

 

Anonymous
Not applicable


@v-siky-msft wrote:

Hi @Anonymous ,

 

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?

Eelman
Community Champion
Community Champion

@Anonymous 

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 @Anonymous ,

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,266)