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 / Counting Attachments t...
Power Apps
Answered

Counting Attachments to enable a button

(1) ShareShare
ReportReport
Posted on by 119

Hi everyone,

 

I need to enable a button based on the count of attachments. If the attachment datacard is not in a form it works but I can't get the value from the datacard property when it's in the form. I'm using countrows - is there another way to achieve this?

DSFlemming_0-1641511459962.png

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,283 Most Valuable Professional on at

    Hi @DSFlemming ,

    I think you are yet another victim of this bug

  • DSFlemming Profile Picture
    119 on at

    This is seriously irritating. Is there any way to add an attachment to a list without a form?

  • DSFlemming Profile Picture
    119 on at

    For what it's worth, you can't access a variable from inside the form either. I tried to update a counter when adding an attachment and nothing happens. It just stays at its initialised value.

    DSFlemming_0-1641516285022.png

     

  • WarrenBelz Profile Picture
    155,283 Most Valuable Professional on at

    Hi @DSFlemming ,

    There is something else strange here - I have duplicated this error before as you see from the post, however I just did the below

    WarrenBelz_0-1641519062781.png

    WarrenBelz_1-1641519078082.png

     

  • DSFlemming Profile Picture
    119 on at

    Interesting. Just created a new project just incase there was something quirky in my current app but no change. Tried a different user - no change. Just have to wait I guess.

    Where did you set the variable?

  • WarrenBelz Profile Picture
    155,283 Most Valuable Professional on at

    Hi @DSFlemming ,

    On the OnSelect of the button outside the gallery.

  • Verified answer
    DSFlemming Profile Picture
    119 on at

    Just spoke to microsoft support, the FormMode must be New in order to access values in the form. I was testing my progress in Edit mode. I didn't realise the different modes would have that effect. 

    Always learning! 

  • WarrenBelz Profile Picture
    155,283 Most Valuable Professional on at

    Hi @DSFlemming ,

    That does not really help the bug - it makes it worse. There are always needs to access form information in both Edit and View modes.

  • DSFlemming Profile Picture
    119 on at

    Agreed. It solves my issue but it's still going to be a problem. 

  • blaze4fun Profile Picture
    13 on at

    That's awesome...and a better workaround than using OnChange (which didn't work with a person lookup).

    Seems to work when editing an existing record by doing NewForm(), getting the record, then EditForm()...or, even easier, just set the form's DefaultMode property to FormMode.New.

     

    I just received an email from Microsoft regarding my issue.  They're still working on it....

    You saved the day!  Maybe this will help them. 😉

     

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,041

#2
11manish Profile Picture

11manish 676

#3
Valantis Profile Picture

Valantis 655

Last 30 days Overall leaderboard