Showing results for 
Search instead for 
Did you mean: 
Post Partisan
Post Partisan

App not storing storing infromation and refreshes

I'm having an issue with my screens on power apps. I am creating a timesheet app for employees in an organisation. Within the app I broke up the days into separate screens to make it more presentable.


So for Monday when they clock in and out it goes straight to the detailed screen, but when it comes to the other days it goes back to the day before screen and I'll now have to input the entries in again for that same day but the info I put in before would still be visible on the SharePoint list that storing the information. 


It started doing this when I created a button to navigate to the next day screen so I'm quite confused

Dual Super User III
Dual Super User III

The screens of an app don't normally store information, the SharePoint list does.  When you navigate away from a screen and then back to it the screen will normally refresh and display the defaults.  Which in your case is probably new entries.  I would need to see what you are doing in your app to provide a real solution.  But I suspect what you want is to set the fields to load the existing record from SharePoint, if its there, or provide a blank entry if its not.  That will require adding an IF() to the default property of the fields.

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

Yes it refreshed and the data was not stored on the same row but another row below it with nothing else and then when I want to clock out that new information is stored on the correct row but with no clock in included as it's still in the row below.


As you can see in the image the two rows with a red underline, a person has clocked in and the information for Monday have been stored whereas for Tuesday_start (clock in) , they clocked in but when it refreshed instead of storing on the same row it's stored in another row below.

Screenshot (129).png

Are you just submitting the form to store the information or using a Patch() statement?  I would use Patch() since it gives you more control when updating some fields but not others in an existing row.

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

How would I do that, I have really used patch function so I'm not sure. I have a total of 6 screens and I made it that once an entry has been added in each day that the next page to show would be the edit form that shows what been added but instead it doesn't do that, so maybe the patch would be a perfect method but the problem would be how to go about it.



The problem is that if you just bind the form to the data source its going to save incomplete information and create duplicate records.  For Patch there are basically two formats you should be aware of


Patch(datasource, defaults(datasource), {fieldname: "value", fieldname2: "value", etc}) - This format creates a new record

Patch(datasource, lookup(datasource, field="Value"), {fieldname: "value", fieldname2: "value", etc}) - This format updates an existing record


For the update version it will only change the values for which you supply a fieldname: "value" pair.  Existing values will remain unchanged.


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

@Pstork1I done that but it doesn't seem to work 


This is the formula used;

Patch(WeeklyTimeSheet, Defaults(WeeklyTimeSheet), {Title:ID, Emp_Name:EmpName.Selected, Mon_Activity:MonAct.Selected.Value, Mon_Contract:MonContract.Selected}) 

Also I only tried it on the Monday Screen, how would it work for the other screens?

As I mentioned, there are two different formats.  The one you used will create a new record.  You can't just use that one formula.  For each screen you'll have to build in logic to call the right Patch() statement based on whether its a new record or an update to an existing record.

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

I don't quite understand what you mean in regards to the update path reference. 

The formula given to update an existing Patch: Patch(datasource, lookup(datasource, field="Value"), {fieldname: "value", fieldname2: "value", etc}) how would I incorporate that. Like you see I'm making a timesheet app and each edit screen represents each day, the first screen which is Monday I used the patch formula given: Patch(datasource, defaults(datasource), {fieldname: "value", fieldname2: "value", etc}). 

So then for the second screen that represents Tuesday, It's the update version on the patch formula I should use, I get that but within the the formula you gave I don't quite understand what should go into  "lookup(datasource, field="Value")"  and once I done this how would this work for the other screens.


Here are images of both the Monday and Tuesday Screens:

Screenshot (158).pngScreenshot (157).png

Hi @SandraAkujobi ,

Have your issue been resolved? If not, happy to help further.


I think you should learn more about the Patch function, the second part in Patch formula is BaseRecord that means the record to modify or create. If the record came from a data source, the record is found and modified. If the result of Defaults is used, a record is created.

In Monday, User created a new record, so the second part of Patch function is Defaults(WeeklyTimeSheet).

However, in Tuesday, User need to save the data to the record created in Monday, so use LookUp function to retrieve the record created in Monday as the BaseRecord of Patch formula.


Patch(WeeklyTimeSheet, LookUp(WeeklyTimeSheet, Title=ID&& Emp_Name:EmpName), {Tues_Activity:TuesAct.Selected.Value, ...}) 

 Hope this helps.


Helpful resources

2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,780)