Hi! I might have a solution, that worked for me.
The variable System.Activity.ChannelData
is what solved it for me. It contains an object called OriginalAttachment that either stores the Base64-file content or an URL to download (if the file is stored in Onedrive).
Steps to capture channelData
- Use a trigger to start the topic, for example that the
Activity.Attachments
table is not empty. - Set a variable (e.g. attachment_data) to
JSON(System.Activity.ChannelData)
. This variable will become astring
. This should happen before any other messages are sent. - Pass the variable to Power Automate.
- Parse the variable to a JSON schema with "Analyze Json".
- Work with the file content as desired. For example, you can convert the base64-encoded data from
contentUrl
to binary withbase64toBinary
in a "Compose". Some connectors need a base64-encoded string anyway. For example, extracting text from a document with AIBuilder to send it to a GPT uses base64-encoded string for the document.
Otherwise, uploading the file with a Onedrive Connector and First(System.Activity.Attachments).Value
and downloading it from Power Automate with the file ID is possible. If you need the filename, it should be in the channelData
Hope this helps!