Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Unanswered

Hide Button if PDF Does Not Exist in SharePoint Document Library

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
 
 
  • PVLove Profile Picture
    PVLove 299 on at
    Hide Button if PDF Does Not Exist in SharePoint Document Library
    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
    WarrenBelz 143,297 on at
    Hide Button if PDF Does Not Exist in SharePoint Document Library
    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

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,297

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,890

Leaderboard