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

Struggling with Patch Function

I've been trying to use patch function to patch several screens. I've gotten to some extent but still finding it difficult.

It's quite different in my case as I i'm creating a timesheet and each edit screen represents days of the week which I'm trying to use patch to collect all entries as one form and instead of putting the patch formula on the submit icon, I have it on the clock in and out buttons on each screens. 

The formula I'm using for the clock in button keeps showing an error:


Set(VARmoncurrentdateandtime, Now());
    SubmittedRecord,      // save the 'Check In' record into a variable
          Title: ID.Text,
          Employee_name: empname.Selected,
          Contract_no: contr.Selected, ApprovalStatus:Approve.Selected,
          ClockIn: MonDay.SelectedDate + Time(Value(MonHour.Selected.Value), Value(MonMin.Selected.Value), 0),
          ClockOut: MonEndDay.SelectedDate + Time(Value(MonEndHour.Selected.Value), Value(MonEndMin.Selected.Value), 0)


when putting the formula for the clock out is that where I would now add in the lookup feature. For the other days how would I cry on with the formula so that entries would be stored as one, because from previous tries they keep storing as individual entities also when I submit one entry I get an approval request for that one entry instead of the whole weekly entry.


Community Support
Community Support

Hi @SandraAkujobi :

Sorry, I don’t understand your needs.

Could you tell me:

1\What is your problem?

  • Solve the error?(the clock in button keeps showing an error)
  • Store the entries  as one?(that entries would be stored as one)

2\What is the error?(the clock in button keeps showing an error)

3\What is the meaning of "entries would be stored as one"?

4\What is WeeklyTimeSheet2's data structure?

5\What are you going to achieve with this app?

Best Regards,



The whole purpose of the app is to collect employees daily timesheet entries and then by the end of the week the entries will be sent out as one weekly form to their respective manager to view and approve. 

Right now the single form is packed with information that need to be put in by the employees for each separate days like contract number, activity,clock in and out etc so I separated each day by screens to make it that each day would have their own form to make it look more presentable. The issue with that is that whenever they put in their entries for each day, they are each stored as one individual entry instead of just being in one form for the week. Which is why I was told to use patch. But it's been very hard to do. there hasn't been a change with the formula at all.  I'm not sure if it's the patch formula I'm using or not. All these information are stored in the sharepoint list for the weeklytimesheet.


This is actually the correct formula used for the actual app. there is no error shown here but the issue is that the entries are being stored twice, so when you clock in the time is stored incorrect, and when you clock out the entries stores again as another entry instead of being in the same form but then it's stored as the right time. As you can see in the two images below.

Set(VARmoncurrentdateandtime, Now());
    SubmittedRecord,      // save the 'Check In' record into a variable
          Title: ID.Text,
          Emp_Name: EmpName.Selected,
          Mon_Activity: MonAct.Selected,
          Mon_Contract: MonContract.Selected,
          Mon_Start: MonDay.SelectedDate + Time(Value(MonHour.Selected.Value), Value(MonMin.Selected.Value), 0),
          Mon_End: MonendDay.SelectedDate + Time(Value(MonendHour.Selected.Value), Value(MonendMin.Selected.Value), 0)

 Screenshot (221).pngScreenshot (222).png

Hi @SandraAkujobi :

Let me sort out the logic, if there are any errors, please help me point out:

  • There are five screens and each screen have a new from.
  • Employees fill out a form every day and submit the contents of the five from at the same time on the last day.
  • The contents of these 5 from will be saved as one record into the SP list.

If my understanding is correct:

  • How are you going to summarize these records into one record? What is its data structure?
  • What is the data structure of the data source SubmittedRecord?

Best Regards,



Yes so there are 6 screens and each screen represents each day except for the 6th screen that has Saturday and Sunday on it together. Employees will fill out the form for the day they are on. Exactly the contents of these 6 forms will be saved as one record into the SP list. 

Initially the form had all the days on it which looked untidy, which is why I created separate screens for them. I was thinking of using patch to summarise each records into one form. 


Title is text.

Activity for each day is a choice column.

Employee is Person/Group column.

Contract is a Lookup column.

Start and End times for each day is date/time field.


Screenshot (229).pngScreenshot (230).png


Helpful resources

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.


New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,202)