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 / Making a button invisi...
Power Apps
Answered

Making a button invisible a day after it's been created

(0) ShareShare
ReportReport
Posted on by 997 Super User 2024 Season 1

Hi, I have this customised SharePoint form. I put this Cancel Request button on that form. So, every item in the form has this button but the visibility makes it different. I'm having issues with its visibility. I want it to be invisible a day (24 hours) after it's been created.

I tried this formula but it doesn't work. I want the checking to be for the item so I compare it to the ID.

//Button3.Visible
LookUp('Leave Request',ID=SharePointIntegration.SelectedListItemID).Created > DateAdd(Today(),1)

 Can anyone help me?

 

Thank you.

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

    Hi @syhrh ,

    Do you want exactly 24 hours or just not be visible the next day (or any day not the present day) - for the day (the issue you have is that Created is Date/Time whereas Today is just a Date (at 0:00)<

    With(
     {
     wCreated:
     LookUp(
     'Leave Request',
     ID = SharePointIntegration.SelectedListItemID
     ).Created
     },
     Text(wCreated,"dd/mm/yyyy" <> Text(Today(),"dd/mm/yyyy")
    ) 

    If you want 24 hours

    With(
     {
     wCreated:
     LookUp(
     'Leave Request',
     ID = SharePointIntegration.SelectedListItemID
     ).Created
     },
     DateDiff(
     wCreated,
     Now(),
     Hours
     ) < 24
    ) 

     

    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

  • syhrh Profile Picture
    997 Super User 2024 Season 1 on at

    Hi @WarrenBelz, I want it to not be visible after 24 hours after it's been created. I pasted your second formula and changed "> 24" to "< 24" to make the button visible if it's less than 24. Thank you so much for your help.

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Thanks @syhrh ,

    Fixed on original post - I must have been focussed more on code than logic at the time.

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard