web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Build Button CheckOut ...
Power Apps
Unanswered

Build Button CheckOut for Time Entries

(0) ShareShare
ReportReport
Posted on 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
 )
 }
 )
)

 

Issue.png
Problem.png
Categories:
I have the same question (0)
  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    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"}
    )

     

     
  • BayuChoirul Profile Picture
    on at

    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,843 Super User 2024 Season 1 on at

    @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 at

    I will try this solution

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard