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 / Hide Button if PDF Doe...
Power Apps
Unanswered

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
    152,855 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
    152,855 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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard