Skip to main content
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

R script Write to csv file on Onedrive


I need to export a dataset to a file on Onedrive for business, whenever my reort gets refreshed in Power Bi service.
I have a R script in Power BI desktop that exports the dataset to a local csv file but I haven't been able to configure it to work on service.


What command in R language should I use to write to Onedrive?


Thanks in advance

Not applicable

Did you find a solution to getting script to write file to a local file in pbi service? I came across this challenge today

No unfortunately I didn't. Customer's requirements changed and I didn't have to do it anymore.

Not applicable

Thanks for the prompt response.

Shame it doesn't seem like it is feasible. Would be really useful to store staging data or to allow storage of API data that only exposes activity in the last 90 days. Was trying to use this to extract and store the Power BI refresh history data. I might post an idea and link back to this post in case someone else stumbles across this problem.

Not applicable
Microsoft Employee
Microsoft Employee

Hi @ZaraSeif123,


What I can think out is using OneDrive REST API since OneDrive isn't a general folder. I would suggest you go to for professional support.



Best Regards,


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

Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.


Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.