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 / Open attachment using ...
Power Apps
Unanswered

Open attachment using the onselect property

(1) ShareShare
ReportReport
Posted on by 8
Hi all,
 
I would like to open the attachment from the attachments control using a button onselect property rather than having to then click it. Tried 2 functions but failed.
 
Select(AttachmentControl)
 
Launch(First(AttachmentControl.Attachments).Value)
 
Neither work for me.
 
It's a data type blob starting with data:application/pdf;base64
 
 
Thanks
Categories:
I have the same question (0)
  • MS.Ragavendar Profile Picture
    7,352 Super User 2026 Season 1 on at
    Hi,
     
    Try this approach
     
    Launch("base4url",& First(AttachmentControl.Attachments).Value) 
     
    If that doesn't work revert back.
     
    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
     
  • Siegfreds Profile Picture
    8 on at
    Thanks for the post! It did not work unfortunately :(.
  • MS.Ragavendar Profile Picture
    7,352 Super User 2026 Season 1 on at
     
    Where you are storing the files in the application?
  • Siegfreds Profile Picture
    8 on at
    I'm not storing them. I duplicated a process Reza Dorrani did on YouTube for creating a PDF and then downloading it directly from within PowerApps. So, I thought rather than clicking one more time on the document name "Commercial Invoice.pdf" from the attachment control I could just simulate that click with the onselect property from the PDF gen button.
     
    This is the Attachment control using the peak at code feature.
    - STCIC_Attachments_CTL:
        Control: Attachments@2.3.0
        Properties:
          BorderColor: =
          BorderThickness: =0
          Color: =RGBA(255, 255, 255, 1)
          DisplayMode: =DisplayMode.View
          Fill: =RGBA(0, 0, 0, 0)
          FocusedBorderThickness: =0
          Font: =Font.Lato
          Height: =30
          HoverFill: =RGBA(0, 0, 0, 0)
          ItemErrorFill: =RGBA(218, 22, 68, 1)
          ItemHoverFill: =RGBA(0, 0, 0, 0)
          Items: =[{Name:"Commercial Invoice.pdf",Value:Substitute(varPDFContent,"""","")}]
          MaxAttachments: =1
          PressedFill: =RGBA(0, 0, 0, 0)
          Size: =8
          Tooltip: =
          Visible: =If(!IsBlank(varPDFContent),true,false)
          Width: =150
          X: =907
          Y: =208
     
    PDF Gen Button after click.png
    PDF Gen Button.png

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 475

#2
WarrenBelz Profile Picture

WarrenBelz 387 Most Valuable Professional

#3
11manish Profile Picture

11manish 289

Last 30 days Overall leaderboard