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 / power apps Attachment ...
Power Apps
Answered

power apps Attachment Control item color

(0) ShareShare
ReportReport
Posted on by 54

is it possible to set the color of items added to the Attachment Control in a canvas app.  For example, if the item attached is a DOCX or XLSX set the color to RED otherwise set color to BLUE.

 

thanks,

Rtc

Categories:
I have the same question (0)
  • Verified answer
    EddieE Profile Picture
    4,641 Moderator on at

    @rcapone 

    I don't think this is possible, at least I couldn't find a way to do it. You could use a Label to notify users instead, eg

    EddieE_0-1699309907697.png

    CountRows( Filter(attach.Attachments, ".jpg" in Name))

     

     

  • rcapone Profile Picture
    54 on at

    if the color can't be changed is there a way to have any attachments having DOCX or XLSX extensions not allowed to be added?  

     

    I came across this post which was helpful.  When the code below is put in the OnAddFile of the Attachment Control; however, it only tests the last attachment - which falls short when multiple files are attached.

    If(
     Right(
     Last(Self.Attachments).Name,
     3
     ) <> "pdf",
     Notify(
     "You can only attach PDF files",
     NotificationType.Error
     );
     Reset(Self)
    )

    the other option is there a way to allow only 1 file at a time to be added to the Attachment Control?

     

    thanks

  • EddieE Profile Picture
    4,641 Moderator on at

    @rcapone 

    I think this solution may do what you need?

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Allow-only-some-file-types-as-attachments/td-p/469316

     

    The solution checks for PDF but you can change to DOCX and XLSX. The author uses a label (visible only when the condition is triggered) to notify users they cannot save. Then, the Save button is made invisible if the label is visible.

  • rcapone Profile Picture
    54 on at

    it tests the First attachment which was similar to the code I found in the link below was testing the Last attachment. 

    https://powerusers.microsoft.com/t5/Building-Power-Apps/PowerApps-Enforce-File-Type-on-the-Attachment-Control/m-p/631573/highlight/false#M200259

     

    I used the Count approach you initially posted.

     

    thanks 

    Rtc

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 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard