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 if PDF Doe...
Power Apps
Answered

Hide Button if PDF Does Not Exist in SharePoint Document Library

(0) ShareShare
ReportReport
Posted on by 299
Hello Community!
I have a gallery with two buttons that link to separate PDF files in a SharePoint document library, btnAmendedLink links to a PDF file that is titled 'Amended Pink Slip-EmployeeName-EmployeeID.pdf' and btnPinkSlipLink links to a PDF file titled 'Pink Slip-EmployeeName-EmployeeID.pdf.'  I'm trying to disable or hide the Amended Pink Slip-Name-ID.pdf file if there is no 'amended' PDF for the name and ID in the title.  If this is possible can someone help me accomplish this?
Thanks!
PLove
 
 
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,494 Most Valuable Professional on at
    You cannot do any testing if you are referring to the file via an "external" URL such as you have as there is no mechanism in power apps to detect the result of a Launch command (Power Apps does not return an error if the URL does not exist - the error will be in the browser window the file was launched in).
    The only way you can have a chance of this is to link the Library to your Data Sources and test for something like this (the code below will return true if the file exists) however it is not Delegable.
    !IsBlank(
       LookUp(
          DocumentLibrary,
          'File name with extension' = Text(Thisltem.EmployeeID) & "-" & Thisltem.EmployeeName & "-" & ThisItem.SeparationDate & ".pdf"
       ).'Link to item'
    )
    The only way to fix this would be to have a Text field in the Library containing the file name and then test on that field.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • PVLove Profile Picture
    299 on at
    Morning @WarrenBelz,
    Thank you for responding and my apologies for not answering sooner.  I will work with your suggestion and see if I can make it work.
    Patti
  • WarrenBelz Profile Picture
    154,494 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    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

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 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard