cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

onedrive for business convert file action - from email attachment

I am trying to build a flow where it takes the attachment from an email I receive, uses the OneDrive for Business "Convert File" action to convert the file to PDF and then saves the file into a folder on a OneDrive for Business account.

 

The flow fails on on the Convert File action with the following error, any ideas how to get this working?

{
  "status"400,
  "message""The provided drive id appears to be malformed, or does not represent a valid drive.",
  "source""api.connectorp.svc.ms"
}

 

Here is how I have the flow setup:

image.png

 

I have been able to successfully use the OneDrive for Business Convert File Using Path action but that means I have already saved the non-pdf version of the file in a location which I am trying to avoid.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

which file type does your attachment file belongs to?

Could you please show a bit more about the attachment of the received email?

 

The error message told that the value that you filled within File field of "Convert file" action is invalid. The File field of "Convert file" action of OneDrive for Business connector is required to fill a unique identifier (Id dynamic content) of an existing file. If the file is not existed in OneDrive for Business folder, we could not obtain the unique identifier of the file.

 

More details about the "Convert file" action of OneDrive for Business connector, please check the following article:

Convert file

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "When a new email arrives" trigger.
  • Add a "Apply to each", input parameter set to Attachments dynamic content of the trigger.
  • Within "Apply to each" action, add a "Create file" action, specify Folder Path, File Name field set to Name dynamic content of the trigger, File Content field set to Content dynamic content of the trigger.

         Add a "Convert file" action, File field set to Id dynamic content of "Create file" action.

 

        Add a "Create file 2" action, specify Folder Path, File Name field set to File name dynamic content of "Convert file" action, File Content field set to File content dynamic content of "Convert file" action.

 

       Add a "Delete file" action, File field set to Id dynamic content of "Create file" action.

 

Note: The Attachment of my received email is an Excel file.

 

Image reference:16.JPG

 

17.JPG

The flow works successfully as below:18.JPG

 

19.JPG

 

The Converted PDF file opens well as below:

20.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

which file type does your attachment file belongs to?

Could you please show a bit more about the attachment of the received email?

 

The error message told that the value that you filled within File field of "Convert file" action is invalid. The File field of "Convert file" action of OneDrive for Business connector is required to fill a unique identifier (Id dynamic content) of an existing file. If the file is not existed in OneDrive for Business folder, we could not obtain the unique identifier of the file.

 

More details about the "Convert file" action of OneDrive for Business connector, please check the following article:

Convert file

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "When a new email arrives" trigger.
  • Add a "Apply to each", input parameter set to Attachments dynamic content of the trigger.
  • Within "Apply to each" action, add a "Create file" action, specify Folder Path, File Name field set to Name dynamic content of the trigger, File Content field set to Content dynamic content of the trigger.

         Add a "Convert file" action, File field set to Id dynamic content of "Create file" action.

 

        Add a "Create file 2" action, specify Folder Path, File Name field set to File name dynamic content of "Convert file" action, File Content field set to File content dynamic content of "Convert file" action.

 

       Add a "Delete file" action, File field set to Id dynamic content of "Create file" action.

 

Note: The Attachment of my received email is an Excel file.

 

Image reference:16.JPG

 

17.JPG

The flow works successfully as below:18.JPG

 

19.JPG

 

The Converted PDF file opens well as below:

20.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Hi Kris,

@v-xida-msft


The Flow works no problem if you save the file in ODFB first.  I was trying to have it covert the file without having to save the file prior, is this possible?  The documentation on how this works isn't clear so we are struggling to know what the expected capabilities are or if we are experiencing unexpected behavior.  Also are there details on the files types this Convert File will or will not work on?

 

Thanks

Michelle

Hey @Anonymous

 

 

 

At this point it is not possible to convert the file immediately.

You have to create a file first then convert it and delete the created file.

 

Kind regards

 

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Anonymous
Not applicable

@Tom_Slosse

 

Thanks for the reply I think it would be helpful if the documentation on the connector provided this level of detail.

 

Is there any available documentation on which file types are or are not supported for file conversion?

 

 

Thank you!

Michelle

Hey @Anonymous

 

 

I have no idea for the OneDrive connector, I guess all Office documents like Word, Excel and PowerPoint are supported.

I guess you can convert more file types with the Muhimbi conntector but I'm not sure.

 

Kind regards

 

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,766)