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 / How to tell if attachm...
Power Apps
Answered

How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

(0) ShareShare
ReportReport
Posted on by 1,088

Hi, so I want an icon not inside of my form to change colors if at least one attachment is added in the form, before submit.

 

I have tried setting variables, creating collections, setting a label in the form then checking that, etc.

 

Nothing is working though if statements just always come back as blank even when something is added and collections dont populate.

 

I have tried countRows and OnAddFiles and OnRemoveFiles...  if I add a label in the form I can see an accurate count of items, but can't get that data out of the form to do stuff other places?

 

Ideas?

 

Thanks,

Terry

Categories:
I have the same question (0)
  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Try this in a label outside of your form replacing DataCardValueX with the name of your DataCardValue in your Attachments DataCard.

    CountRows(DataCardValueX.Attachments)

     

    attachments.png

  • Mattw112b Profile Picture
    1,088 on at

    So, I did try that and doesn't give me any value??

     

    Screenshot 2022-03-01 162625.png

     

    Terry

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    That is strange.   Just out of curiosity, have you tried any other type of files besides text?   It doesn't make any sense that you would get a different result, but.....

  • Mattw112b Profile Picture
    1,088 on at

    Yes tried many.  Also I didnt show it int he screen capture but I have labels inside the form and those show the correct numbers and have the same formulas...

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Is this a standard canvas app with a form in it, a SharePoint intgration app or a Power Apps for Teams app?

  • Mattw112b Profile Picture
    1,088 on at

    This is a standard standalone Power App, not embedded in SharePoint, but does have the SharePoint backend List.

     

    Thanks,

    Terry

  • Mattw112b Profile Picture
    1,088 on at

    Also no containers or anything if that is where you were going.

  • Verified answer
    JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Can you add a temporary screen and add a new form with the same data source and item properties and then see if you can count the attachments outside of the form in a label?

     

    I actually just added that capability to a totally separate app from where I tested it and it's working fine.

  • Mattw112b Profile Picture
    1,088 on at

    ok created blank screen, added the form exactly like other screen, and it worked!!  I could see a count outside the form...

     

    I checked out all properties etc.  between them both and they are identical??

     

    So I copied the form from the first screen and pasted on the new screen, and it still didn't work??

     

    So then I copied the new form to the old screen and it didnt work?

     

    Getting a bit confused.

     

    So new form on new screen = works

    Old form on old screen - doesnt work

    Old form pasted on new screen = doesnt work

    New form pasted on old screen = doesn't work

     

    So kind of confused on what is going on.

     

    Thanks,

    Terry

  • Mattw112b Profile Picture
    1,088 on at

    I just deleted everything and added a new form to the old screen, and everything is working again??  Thanks for the help.  Would be good to understand why it was acting like that, but at least I can progress now.

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 476

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 339

Last 30 days Overall leaderboard