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)
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?
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
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.
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
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.