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 / Hide button based on v...
Power Apps
Answered

Hide button based on values from table

(0) ShareShare
ReportReport
Posted on by 106

hi, I'm trying to hide button based on values from table..

 

I have table called attendance in sharepoint... the button should visible only when the user checked-in previously... and checkout field is empty.. when particular user logs in application... the i need to match whether the user checked-in and forget to checked-out based on data i attendance table... 

how to achieve this? help me..

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @Abhilash 

    Don’t manage check in and check out in two different fields.  Combine them in a single field called CheckedIn that is a Yes/No type column.  Then set the Visible property of the button to this code:

     

    If(ThisItem.CheckedIn=true, true, false)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Abhilash ,

    Could you please share a bit more about the data structure of your attendance List?

    Do you add a column in your attendance List to store the user display name?

     

    I assume that there is a column in your attendance List to store the user Display name, please consider take a try with the following workaround:

    Set the Visible property of the button to following:

    If(
     !IsBlank(LookUp(attendance, UserName = User().FullName, Checkin)) && IsBlank(LookUp(attendance, UserName = User().FullName, Checkout)),
     true,
     false
    )

    Note: I assume that there is only single one record existed in your attendance List for each user. The UserName represents the column in your attendance List to store the user name of the login user.

     

    More details about the LookUp function, please check the following article:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup

     

    Best regards,

  • Abhilash M abi Profile Picture
    106 on at

    No,There are multiple records for single user..

     

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    @Abhilash ,

    OK, I assume that you want to check if the Checkin field and Checkout field value of the latest record for the current sign in user, right?

     

    Please try the following formula (set the Visible property of Button to following):

    If(
     !IsBlank(Last(Filter(attendance, UserName = User().FullName)).Checkin) && IsBlank(Last(Filter(attendance, UserName = User().FullName)).Checkout),
     true,
     false
    )

     

    In addition, if you want to find specific record in your SP List based on specific date, you could also consider add a Date filter condition in above Filter formula.

     

    Best regards,

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard