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 / Filtering Items in Att...
Power Apps
Answered

Filtering Items in Attachments with Name

(0) ShareShare
ReportReport
Posted on by 133

So in my case, I'm creating an application with two data cards with attachments

Attachment Name - "HardwareGoods" and 

another Attachment Name - "Invoice"

OnAddFile - 

 

Clear(CollectingIncorrectNames);
ForAll(
Self.Attachments.Name,
If(
Not("HardwareGoods" in Name),
Collect(
CollectingIncorrectNames,{Name : Name}
));
If(
CountRows(CollectingIncorrectNames)>0,
Notify("Change Attachment Name to 'HardwareGoods' on the file name", Error); Reset(Self))

On Items - How do I filter only Attachments which has a name with 'HardwareGoods' only not the 'invoice'

Categories:
I have the same question (0)
  • Rhk Profile Picture
    133 on at

    @WarrenBelz Can you help me with this

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

    Hi @Rhk ,

    Two things - this will sort the first one out OnAddFile

    If(
     !("HardwareGoods" in Last(Self.Attachments).Name),
     Notify(
     "Change Attachment Name to 'HardwareGoods' on the file name",
     Error
     );
     Reset(Self)
    )

    However, if your two attachment controls are on the one Form, the second one submitted (in the order they are on the form) will overwrite the first one, so you cannot save two sets in one SubmitForm)

     

    Please click Accept as solution 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 Thumbs Up.

    Visit my blog Practical Power Apps

  • Rhk Profile Picture
    133 on at

    On Items Property - How do I filter Attachments which has a name with 'HardwareGoods' but not the 'invoice'

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

    Hi @Rhk ,

    I am not sure of the other consequences of this when saving, but you can display only HardwareGoods in the Attachment Control Items with

    Filter(
     ThisItem.Attachments,
     "HardwareGoods" in DisplayName
    )

     

    Please click Accept as solution 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 Thumbs Up.

    Visit my blog Practical Power Apps

     

  • Verified answer
    Rhk Profile Picture
    133 on at

    @WarrenBelz Thanks for your help. A few lines of code did work from your responses but got a better visual solution from this video -

    https://www.youtube.com/watch?v=hJQjGE-oUpM

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard