Skip to main content

Notifications

Power Apps - Building 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,076

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

  • Mattw112b Profile Picture
    Mattw112b 1,076 on at
    Re: How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

    Customized... I mean I deleted out fields I didn't need?  I had some code on the on add and on delete to try to increment a variable.  But then deleted that too?  The weird thing is when I had the form working on the other screen and I copied and pasted to the old screen it didn't work there either??  But like I said things seem to be working by delteing that form and starting over.

  • JR-BejeweledOne Profile Picture
    JR-BejeweledOne 5,836 on at
    Re: How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

    Edited:   I missed your last post where you said you started over. 

     

    All I can think is there is something you are missing or something has gotten corrupted on your one screen.    Has your first form been customized at all?

  • Mattw112b Profile Picture
    Mattw112b 1,076 on at
    Re: How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

    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.

  • Mattw112b Profile Picture
    Mattw112b 1,076 on at
    Re: How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

    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

  • Verified answer
    JR-BejeweledOne Profile Picture
    JR-BejeweledOne 5,836 on at
    Re: How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

    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
    Mattw112b 1,076 on at
    Re: How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

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

  • Mattw112b Profile Picture
    Mattw112b 1,076 on at
    Re: How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

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

     

    Thanks,

    Terry

  • JR-BejeweledOne Profile Picture
    JR-BejeweledOne 5,836 on at
    Re: How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

    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
    Mattw112b 1,076 on at
    Re: How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

    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
    JR-BejeweledOne 5,836 on at
    Re: How to tell if attachment control from SharePoint has at least 1 attachment in it outside of the form

    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.....

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard