cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nparadiso
Frequent Visitor

AbsoluteUri from attachment control

Hi Everyone

 

Im trying to obtain the AbsoluteUri from from the attachment control to add to a collection, it currently stores the value as an azure blob (see below)

 

nparadiso_0-1649831718452.png

 

nparadiso_1-1649831983907.png

 

 

My Collect code is as follows:

 

ClearCollect(
collectAttachments, AddColumns(RenameColumns(AttachmentControl.Attachments,"Value","ContentBytes"), "@odata.type", ""));

Set(JSONAttachments,
JSON(collectAttachments,JSONFormat.IncludeBinaryData));

 

 

I collect the attachments in JSON to the parse to a flow for the attachments to send off in an email, but I need the absoluteuri instead of the azure blob for the email connector to recognize the attachment

 

How can I do this?

 

 

 

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @nparadiso ,

It will be

https://YourDommainName.Sharepoint.com/sites/YourSiteName/Lists/YourListName/Attachments/ItemIDNo/YourFileName.Extension

 

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

BCBuizer
Super User
Super User

Hi @nparadiso ,

 

To retrieve the AbsoluteUri, you'll have to reference your data source as the attachment control will not return it.

 

You can do so by selecting an item and then selecting the properties, for instance:

 

First(TEST).Attachments.AbsoluteUri

 

In your code it would look something like this:

 

ClearCollect(
	collectAttachments, 
	AddColumns(
		RenameColumns(
			AttachmentControl.Attachments,
			"Value",
			"ContentBytes"
		),
		"@odata.type",
		"",
		"AbsoluteURI",
		[Similar to AttachmentControl.Items].AbsoluteURI
	)
);

 

Since AttachementControl.Items can't be referenced, you'll have to hardcode that part.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Hi @BCBuizer 

 

I'm a bit confused by the explanation sorry, I'm only a few months into powerapps developing

 

There is no specific data source as the control is not working out of a list, it is an independent control linked to the Office365.Outlook.SendEmailV2 connector using this guide I found below

 

PowerApps Email Attachments with the office 365 connector and attachment control - YouTube

 

Only thing is there is a flow Ive made where the user fills out input boxes in the app and populates a word template, it then emails that word document created.

 

The attachment control is to allow the user to add additional attachments that will be sent to the flow using the absoluteuri. Am I missing the mark with understanding your solution? (pls be patient with me haha) or is there something else necessary

BCBuizer
Super User
Super User

Hi @nparadiso ,

 

Looking at the video, the Office365 connector is used in PowerApps to send out the mails, rather than Power Automate. 

 

Even then, the sendEmail(v2) action in Power Automate needs a file name and content, not the absoluteURI.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,695)