So i have a form where i ask my users to enter hours (to show how busy they will be in the next period). I want this form to be evergreen and editable. Due to their capacity & hours allotted to different areas changing throughout the week. There are two filters for this form, user, and work period.
When a form is submitted, it goes into a SharePoint list. I want a user to be able to go back into the form, and edit a specific periods hours. This would require the form to display their last entry, with the ability to edit, connected to the SP list. I was told, 'LastSubmit' wouldn't work in this case, due that function only showing last submitted entry in the current session. How would i go about this? Would I have to do an onStart Collection of the current users last entry into the SP data source?
Any ideas?
The SharePoint list has these columns
Name-WorkPeriod-WorkHrs-OutofOfficeHours-TrainingHours-OtherAdministrativeHours
-Each of these columns is editable in the PowerApp forms.
Solved! Go to Solution.
Hi @moelhag
All SharePoint lists have a hidden ID column. Filter the list by the User and then sort it by the ID, descending and use First() to select the most recent record. If you create a variable in the OnStart property of your app like Set(username,User().FullName) and set the form's datasource is YourList and the following is the Item property
First(Sort(Filter(YourList,Name=username),ID,Descending))
by using the variable username, instead of User().FullName in the formula, you should avoid delegation issues. Also, using First(Sort( will avoid delegation problems and continue to work even if your list exceeds the maximum number of items, ie 500 or 2000. Last() and Max() are not delegatable in SharePoint and will give incorrect results if the list is more than the item limit.
Hi @moelhag
All SharePoint lists have a hidden ID column. Filter the list by the User and then sort it by the ID, descending and use First() to select the most recent record. If you create a variable in the OnStart property of your app like Set(username,User().FullName) and set the form's datasource is YourList and the following is the Item property
First(Sort(Filter(YourList,Name=username),ID,Descending))
by using the variable username, instead of User().FullName in the formula, you should avoid delegation issues. Also, using First(Sort( will avoid delegation problems and continue to work even if your list exceeds the maximum number of items, ie 500 or 2000. Last() and Max() are not delegatable in SharePoint and will give incorrect results if the list is more than the item limit.
User | Count |
---|---|
177 | |
118 | |
88 | |
44 | |
41 |
User | Count |
---|---|
241 | |
153 | |
127 | |
77 | |
72 |