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 Apps
Unanswered

Disable Button

(0) ShareShare
ReportReport
Posted on by 209

Hello! Im making a employee time clock and My data source is SharePoint. I have the Columns TitlePunch In , Punch Out, EmployeeIDJob (choices of job sites) , Date and Time, LocationLongituteLatitidue in sharepoint.  The punch in/out date pickers have a string for the Defaultdate= Now(), so that it is automated and will be hidden like many other fields. I have two buttons called Punch In and Punch out. I plan to make the button "Punch In" submit hidden fields and navigate to a second page to display all of the submitted information on a display form. But I want the Punch Out button disabled unless the "Punch In" button was already used to submit. What "If" statement must I use?

new.PNG

 

new2.PNG

#2. I want to add up the total hrs worked that day as well as that week

Categories:
  • turnerj3 Profile Picture
    2,039 on at

    Sounds like you are going to need to Lookup the list item by Employee ID to see if there is a value in the Punch In column.

    If(!IsBlank(LookUp(SharepointList,EmployeeID=EmployeeID.dropdown.SelectedItem And Created>Today()-1)),true)

     

    As far as adding up hours you could use something like this in a text label.

    LookUp(SharepointList,EmployeeID=EmployeeID.dropdown.SelectedItem And Created>Today()-1),DateDiff(ThisRecord.Created,ThisRecord.Modified,TimeUnit.Hours))

     

     

  • Broly123 Profile Picture
    209 on at

    @turnerj3 Thank you for the response and answer! Will I be using If(!IsBlank(LookUp(SharepointList,EmployeeID=EmployeeID.dropdown.SelectedItem And Created>Today()-1)),true) on the Punch In button using "Onselect" property?

  • turnerj3 Profile Picture
    2,039 on at

    Put it in the Punch out Visible 

  • Broly123 Profile Picture
    209 on at

    When using the Code, EmployeeID=EmployeeID.SelectedItem does not show up, I only get Value as the next condition. I believe its because I didn't insert dropdown columns, the data fields were generated from Sharepoint. So shouldn't I use something like EmployeeID=EmployeeID_DataCard2.Value  or something with the datacard?

     

    new3.PNG

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard