2

I'm trying to automate saving of attachment from outlook.com using Microsoft flow.

The attachment in question is a password protected PDF.

I tried using
Attachment Content as value for File Content in Onedrive Action Create File

It gave the error:
InvalidTemplate. Unable to process template language expressions in action 'Create_file' inputs at line '1' and column '2492': 'The template language function 'base64ToBinary' expects its parameter to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#base64ToBinary for usage details.'.

Is there a way to fix this or work around this?

Thanks for any help in advance.

Alen Alex
  • 897
  • 4
  • 15
  • 31

1 Answers1

1

I was able to find a solution for this.
In the question, I was trying to read the content of the pdf which is password protected. This does not work as it requires the password to be provided (which is not an option).

The solution for the same is:
1. Get the email with the attachment (as a trigger/action).
2. Use Get Attachment Action to get the attachment.
3. To get the file content, use the property (dynamic content) namely Body from Get Attachment.

This can be used to create a new file in say Onedrive. This creates a new file which is still password protected, but with the right content.

I hope this helps.

Alen Alex
  • 897
  • 4
  • 15
  • 31