cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anson
Regular Visitor

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
v-yamao-msft
Community Support
Community Support

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
v-yamao-msft
Community Support
Community Support

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.

@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.

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.

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.

 

v-yamao-msft
Community Support
Community Support

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

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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (83,745)