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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Checked in at least 1 ...
Power Apps
Answered

Checked in at least 1 hour before scheduled time

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I have a SharePoint list below

 

kinghnvn_0-1637504365006.png

 

Could you please help to set up CheckIn button as below?

 

If  start date = today and start time < today time - 1 hour -> DisplayMode is Edit

else -> DisplayMode is Disabled

 

kinghnvn_2-1637504517793.png

Thanks.

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,427 Most Valuable Professional on at

    HI @kinghnvn ,

    This should be the structure.

    If(
     Text('Checkout From',"mm/dd/yyyy") = Text(Today(),"mm/dd/yyyy") && 
     DateDiff(
     'Checkout From' 
     Now(),
     Hours
     ) > 1,
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • kinghnvn Profile Picture
    on at

    seems the code doesn't work.

    ThisItem.'Check Out From' -> it show full time (date & hour). How can split it?

     

    kinghnvn_1-1637545859426.png

     

     

  • WarrenBelz Profile Picture
    153,427 Most Valuable Professional on at

    @kinghnvn 

    I am assuming that is a date and time field - if so, this makes it a date (as posted)

     Text('Checkout From',"mm/dd/yyyy")

    then 

     Text('Checkout From',"mm/dd/yyyy")

    converts the current date to the same format and they should compare

  • kinghnvn Profile Picture
    on at

    it works if booked date is different from current date (3rd line - screenshot) but if it's the same day and different time (hours / minutes), it won't work. Please advise. Thanks.

     

    If(
    Text(
    ThisItem.'Check Out From',
    "mm/dd/yyyy"
    ) = Text(
    Today(),
    "mm/dd/yyyy"
    ) && DateDiff(
    ThisItem.'Check Out From',
    Now(),
    Hours
    ) > 1,
    DisplayMode.Edit,
    DisplayMode.Disabled
    )

     

    kinghnvn_0-1637562883077.png

     

  • WarrenBelz Profile Picture
    153,427 Most Valuable Professional on at

    @kinghnvn ,

    You need to add the date comparison I posted

    Text('Checkout From',"mm/dd/yyyy") = Text(Today(),"mm/dd/yyyy") 

     

    see a test I did below

    DateTimeTest1.jpg

    Then within an hour

    DateTimeTest2.jpg

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • kinghnvn Profile Picture
    on at

    thanks @WarrenBelz ,

    How to hide the check-in button if more than 15 minutes?

  • WarrenBelz Profile Picture
    153,427 Most Valuable Professional on at

    @kinghnvn ,

    Different question, but you would need a timer control started at screen OnVisible then set a Variable at OnTimerEnd

    UpdateContext({varHide:true})

    then your button DisplayMode

    If(
     !varHide &&
     Text('Checkout From',"mm/dd/yyyy") = Text(Today(),"mm/dd/yyyy") && 
     DateDiff(
     'Checkout From' 
     Now(),
     Hours
     ) > 1,
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • kinghnvn Profile Picture
    on at

    if I set Visible is UpdateContext({varHide:true}), all CheckIn button hidden and cannot see it.

     

    kinghnvn_0-1637593411964.png

     

  • WarrenBelz Profile Picture
    153,427 Most Valuable Professional on at

    @kinghnvn ,

    That code is for OnTimerEnd of the timer control, not the Visible for the button. Here is a document on Timer operation.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 361

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard