cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anson
Level: Powered On

Get files from SharePoint to Business Central

I am trying to get a txt file and CSV file from Sharepoint to Business Central using Flow.

My flow is : Recurrence>> Sharepoint Get files (Properties Only) >> Apply to each value (Sharepoint Get file Content >> Business Central On-Premises Create Item)

i have created an api linking with a table with BLOB fields, but i fail everytime in the create item function.

However, if i am not putting the file content from "Get File Content" to "Create Item", it works.

Have anyone tried to do something like this? i have been stucked here for quite a while now. I really appreciate some helps. Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Get files from SharePoint to Business Central

Hi @Anson ,

 

I guess that File name and File content fields are custom field you added to the table. After more researches, I guess that the return result of dynamic content File content is not supported by the custom field. So an error message “Invalid request body” occurred.

 

I have seen similar request on Flow ideas Forum, please check it at here:

https://powerusers.microsoft.com/t5/Flow-Ideas/Attached-file-in-email-to-Incoming-Documents-in-Busin...

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
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
Community Support Team
Community Support Team

Re: Get files from SharePoint to Business Central

Hi @Anson ,

 

I don’t have an account for Dynamics 365 Business central to test this issue. Not sure how the business central action Create item works.

 

From the documentation, Row of Create item is “row to insert into the specified table in Dynamics 365 Business Central”. Have you defined available content for each row?

 

I have made another test with SharePoint action Create item. The file content could be saved to the list successfully.

 

An image likes below:

1.PNG

 

Hope this could be a reference for you.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anson
Level: Powered On

Re: Get files from SharePoint to Business Central

@v-yamao-msft 
Thanks for your reply.

I think i was doing it correctly, however i always get the same error.

my setup:
Capture.PNG


The Error I get:
Capture1.PNG

It seems like no matter what i put in the file content , it is the same error. Btw the file content is of BLOB type.

Community Support Team
Community Support Team

Re: Get files from SharePoint to Business Central

Hi @Anson ,

 

Thanks for updating.

 

You mentioned that the file content is of Blob type, could you try to narrow down this issue by using a .txt file, or .doc file to see if it will work?

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anson
Level: Powered On

Re: Get files from SharePoint to Business Central

Thanks for your reply @v-yamao-msft.

I have been using txt file, and i can only use txt file. it is probably what causing the error. 

I tried all the "binary", "datauritobinay",...etc function from flow, it always show the same error.

Im also trying to use http request method to call a post request to the api, but then the blob fields became "FileContent@odata.mediaEditLink" and "FileContent@odata.mediaReadLink".

it is just getting more confusing.

 

Community Support Team
Community Support Team

Re: Get files from SharePoint to Business Central

Hi @Anson ,

 

I guess that File name and File content fields are custom field you added to the table. After more researches, I guess that the return result of dynamic content File content is not supported by the custom field. So an error message “Invalid request body” occurred.

 

I have seen similar request on Flow ideas Forum, please check it at here:

https://powerusers.microsoft.com/t5/Flow-Ideas/Attached-file-in-email-to-Incoming-Documents-in-Busin...

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
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

Anson
Level: Powered On

Re: Get files from SharePoint to Business Central

Hi @v-yamao-msft,

Thanks for your reply and your efforts. 

 

So it really is the problem of the custom fields.

I think i will avoid using custom fields for this or find another way.

Best regards,
Anson




 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,623)