Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have found a way to write to a file using R script editor in PowerBI. But the file directory is located on my hard drive. I'm trying to get it to write to a file that is located in Sharepoint. I'm not familiar with R coding, I used the code located in a tutorial.
require(gdata)
write.table(system(trim(dataset), file="(directory)", sep = "\t", row.names = FALSE))
plot(dataset);
Instead of '(directory)' I would include the URL which includes the directory to the folder in Sharepoint. However, it doesn't work.
I appreciate any help!
Solved! Go to Solution.
Hi @Anonymous,
The last part of the code "upload-file C:/Users/Isra/Documents/pick.txt https://company.sharepoint.com/sites/wm/Folderdirectory.aspx"may be modified compares to the code in this thread.
As this issue is more related to R code, I would suggest you post here as I suggested before.
Best Regards,
Qiuyun Yu
Hi @Anonymous,
You can refer to this same thread: https://stackoverflow.com/questions/45948534/saving-files-to-sharepoint-folder-from-r
If you have further question about write R script, please post a thread here.
Best Regards,
Qiuyun Yu
So I used this code:
require(gdata)
system("curl --ntlm --user username:password--upload-file C:/Users/Isra/Documents/pick.txt https://company.sharepoint.com/sites/wm/Folderdirectory.aspx")
plot(dataset);
And it ran because it plotted the dataset, however I can't see the file uploaded into the folder. Is there a mistake or a way I can see how the code ran?
Did you found the solution on how to automaticaly export an csv to a Sharepoint folder usin R script?
Hi @Anonymous,
The last part of the code "upload-file C:/Users/Isra/Documents/pick.txt https://company.sharepoint.com/sites/wm/Folderdirectory.aspx"may be modified compares to the code in this thread.
As this issue is more related to R code, I would suggest you post here as I suggested before.
Best Regards,
Qiuyun Yu
did it work for you , if so please do post the code that you have used . Even I have a requirement where I need to export PBI Data set to Share point folder using R
Hello could you please help me find a way to do the automatic CSV extraction to sharepoint?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |