cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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

 


@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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (26,726)