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

6 REPLIES 6
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.
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.

mac1520
New Member

I use DoD 365 (US Government) version and trying to build a flow in Power Automate from Form to Lists and add an attachment.  When I build a new step and search for the OneDrive for Business Connector, it does not show up on the list of connector choices.  Reading through the MS troubleshooting webpage, it says the OneDrive Business Connector is not available for US Government. 

 

Is there another connector I can use that will accomplish the same thing? 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,529)