cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ManishM
Microsoft
Microsoft

Office365.GetAttachment(): How to get attachment ID to download it

Does anyone know where/how I can get attachment ID which is needed to download attachment from email in PA?

Thank syntax is:

Office365.GetAttachment(Message Id,Attachment Id)

I get only the message Id when I access emails through office 365 connector in PA.

 

Any help would be much appreciated.

 

Thank you,

Manish

2 ACCEPTED SOLUTIONS

Accepted Solutions
ManishM
Microsoft
Microsoft

ahha...got it! In case others would like to know:

the attachement ID comes as a table within each email so need to access it through Table hosting controls. If you would like to know more, contact me here.

 

Thanks

Manish

View solution in original post

I am assuming you are able to show emails using Office365Outlook connector into a gallery, say 'Email_GAL'.

Next, add a datacard. Now, this is the tricky part. To add data card, you'll need to add 'Display Form' first and will need to connect it to any table in you data source. Next, select 'Attachments' as one of the fields/columns to show in the Display Form from the Properties pane. This will show the datacard control within the Display Form. Copy just the datacard control and paste it outside on the canvas. Now, change the 'Items' property for this datacard to Email_GAL.Selected.Attachments.

 

Select one of your emails from the Email_GAL that has attachments. This will show you list of attached files to that email. Now, clicking each file in the datacard will give you a download dialog.

 

Important: in the properties pane, for the DataCard, click 'Advanced'. This is where you need to make sure that in the DATA section select Name for the Name dropdown and ContentBytes for the Value dropdown

 

Table supporting controls are like DataCards, Gallery, List, dropdown, radio button...

Here are some screen shots from the sample:

ManishM_0-1608335628919.pngManishM_1-1608335668376.png

Hope this helps retrieving the attachments and also able to click download them.

 

If you want to get the ID of the attachments then simply add another gallery and in the 'Items' property of it type Email_GAL.Selected.Attachments. Below is the screen shot

 

ManishM_2-1608336053081.png

 

View solution in original post

7 REPLIES 7
ManishM
Microsoft
Microsoft

ahha...got it! In case others would like to know:

the attachement ID comes as a table within each email so need to access it through Table hosting controls. If you would like to know more, contact me here.

 

Thanks

Manish

ataps
Regular Visitor

how?
sandeepp
Frequent Visitor

How do i get to download the attachment with respect to an email? I am able to get the attachment and its name. But when i am using the Office365.GetAttachment() function nothing is happening. 

I too, would like to know how to display the attachments on a screen. I have a screen where I can select emails from a Gallery and display Subject, From, Body, etc. But, how do I display any attachments the email has? And then, how to download those attachments if the user so chooses?

 

Many Thanks,

 

Steve

ManishM, Could you provide a simple example of parsing the Table hosting control in order to discern the attachmentid?

Many thanks,

XZAP

I am assuming you are able to show emails using Office365Outlook connector into a gallery, say 'Email_GAL'.

Next, add a datacard. Now, this is the tricky part. To add data card, you'll need to add 'Display Form' first and will need to connect it to any table in you data source. Next, select 'Attachments' as one of the fields/columns to show in the Display Form from the Properties pane. This will show the datacard control within the Display Form. Copy just the datacard control and paste it outside on the canvas. Now, change the 'Items' property for this datacard to Email_GAL.Selected.Attachments.

 

Select one of your emails from the Email_GAL that has attachments. This will show you list of attached files to that email. Now, clicking each file in the datacard will give you a download dialog.

 

Important: in the properties pane, for the DataCard, click 'Advanced'. This is where you need to make sure that in the DATA section select Name for the Name dropdown and ContentBytes for the Value dropdown

 

Table supporting controls are like DataCards, Gallery, List, dropdown, radio button...

Here are some screen shots from the sample:

ManishM_0-1608335628919.pngManishM_1-1608335668376.png

Hope this helps retrieving the attachments and also able to click download them.

 

If you want to get the ID of the attachments then simply add another gallery and in the 'Items' property of it type Email_GAL.Selected.Attachments. Below is the screen shot

 

ManishM_2-1608336053081.png

 

That worked perfectly and was exactly what I needed. Thanks!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Top Solution Authors
Top Kudoed Authors
Users online (3,850)