Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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

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

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors