Skip to main content
Community site session details

Community site session details

Session Id : dTA45Am+Cp8E5hFdDOV2Ch
Power Apps - Building Power Apps
Unanswered

Build Button CheckOut for Time Entries

Like (0) ShareShare
ReportReport
Posted on 16 Feb 2021 07:30:19 by

Hi Community. I need help to fix this.

 

I make an application about time entries. But on the checkout button, I get an error. the error message is "
Unexpected characters. The formula contains 'ParenClose' Where 'CurlyOpen' is expected ". My code in Button check out like this.

Patch(
 'Bookable Resources',
 CurrentLogin
 {
 'Bookable Resources'
 }
); 
UpdateContext(
 {
 Duration : Duration + DateDiff(
 DateTimeValue(EndTime),
 DateTimeValue(StartTime),
 Minutes
 )
 }
);
Patch(
 'Bookable Resources',
 CurrentLogin,
 {
 'Bookable Resources'.name
 'Bookable Resources'.Status : "Working"
 {
If(
 Not(IsBlank(End)),
 Patch(
 'Time Entries',
 GalleryTimeEntries.Selected,
 {
 'Work Order Service Task': GalleryServices.Selected,
 End: Now(),
 Duration: DateDiff(
 GalleryTimeEntries.Selected.Start,
 Now(),
 Minutes
 )
 }
 ),
Patch(
 'Time Entries',
 LookUp(
 'Time Entries',
 'Time Entries' = GalleryTimeEntries.Selected.Start
 ),
 {
 End: Now(),
 Duration: DateDiff(
 LookUp(
 'Time Entries',
 'Time Entries' = GalleryTimeEntries.Selected).Start,
 Now(),
 Minutes
 )
 }
 )
)

 

  • BayuChoirul Profile Picture
    on 16 Feb 2021 at 08:44:47
    Re: Build Button CheckOut for Time Entries

    I will try this solution

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on 16 Feb 2021 at 08:24:33
    Re: Build Button CheckOut for Time Entries

    @BayuChoirul ok in that case you will have to lookup the id for that record, something like 

    Patch(
    'Bookable Resources',
    {ID:Lookup the ID which you want to update or something similar},
    {ColumName: "Value to that column"}
    )

    Have a look at this:

    I created a collection _SomeData

    ClearCollect(_SomeData,{Name: "One", Value: 100, ID: 1})

     
     

    Now to update that collection i will patch it, where the ID is 1

    Patch(_SomeData,{ID:1},{ Value: 200})

     
  • BayuChoirul Profile Picture
    on 16 Feb 2021 at 08:11:06
    Re: Build Button CheckOut for Time Entries

    I didn't try to create a new record. I used an existing record, then I counted the check-in time and check-out time

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on 16 Feb 2021 at 07:54:54
    Re: Build Button CheckOut for Time Entries

    hi @BayuChoirul 

     

    Are you trying to create a new record? Defaults('Bookable Resources') will replace CurrentLogin 

     

    Patch(
     'Bookable Resources',
     CurrentLogin
     {
     'Bookable Resources'
     }
    ); 

    something like
    Patch(
    'Bookable Resources',
    Defaults('Bookable Resources'),
    {ColumName: "Value to that column"}
    )

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete