Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi All,
Using CSV parser extension service WriteCSVFile am storing CSV file in SystemRepository. But my requirement is to save the file to local folder. Is there a way we can achieve this.
Thanks in Advance.
Regards
Lakshmi.
Solved! Go to Solution.
This will not work. All Services run on server side. There have no access to your local filesystem.
First you create the file in a FileRepository and then you can use the GetFileListingWithLinks-Service of this FileRepository to download the file.
Hi,
if you want to have an Export in your Mashup.
Use Data Export widget. This will save the CSV in your default browser location (or ask) when you press it.
Hi,
Thank you for reply, but I want to avoid extra click for data export. Instead storing in Repository I was trying to save in local folder using below code.
var params = {
path: "/Data.csv" /* STRING */,
data: result1 /* INFOTABLE */,
fileRepository: ??? --- Is there a way we can store in local folder?
// fileRepository: "SystemRepository" /* THINGNAME */,
withHeader: true /* BOOLEAN */
};
// no return
Resources["CSVParserFunctions"].WriteCSVFile(params);
Here WriteCSVFile function stores CSV in fileRepository mentioned in params(Here it is SystemRepository).
This will not work. All Services run on server side. There have no access to your local filesystem.
If the export is somehow triggert from any User Input. Then just add a "automatic export" handler in the Date Export Widget and you will avoid an extra click.