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 / Help with Hiding a But...
Power Apps
Answered

Help with Hiding a Button based on # of attachments

(0) ShareShare
ReportReport
Posted on by 30

Hello,

 

I have an app that acts as a way to complete a form with various screens that attach a signature to a sharepoint list item via an attachment.

 

I would like to somehow make the "sign/save form" button not visible if the item already has two attachments (basically two signatures). 

 

Is there any sort of "If" statement I can implement on a visibility control that will make a button not visible if the item being viewed on the form has 2 or more attachments? 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @SamR 

    You will need to reference the attachments table of the record you are working on.

    With that you can set the Visible property of the button to:

    CountRows(yourRecord.Attachments) < 2

     

    I hope this is helpful for you.

  • SamR Profile Picture
    30 on at

    Awesome @RandyHayes . That does seem to work. I have one follow up question I wonder if you may be able to help me with.

     

    In another part of my form I have a section that I would like to display specific attachments. I have found and am using the "first(thisitem.attachments).value" to display the first attachment/signature.

     

    Is there a way to specifically display the second?

     

    I tried "second(thisitem.attachments).value" but it seems to affect a function to do with time rather than the second item in my attachment list.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @SamR 

    There is no Second function.  You can get the second record with this:

    Last(FirstN(thisitem.attachments, 2)).value

     

  • SamR Profile Picture
    30 on at

    Understood - looks like I can use that to select any specific item in the list with a little tweaking. Very appreciated. 😁

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @SamR 

    Yes, as you can see the number 2 in that formula "essentially" determines which record you are going to get.

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