Hi @seanccc, I think that is what ThingWorx is designed: FileRepository for dealing with the files.
However, if you are looking for exporting infotables, a plain service with output as infotable will do the trick.
You can get the information via RestAPIs.
If you also want to download it as a file, write the infotable into a CSV file, and set a constant 24h repeat clean timer or dynamically generate clean timers is another option.
The following codes generate a timer at runtime:
// create a timer
Resources["EntityServices"].CreateThing({
name: "newTimer" /* STRINGS, better to dynamically generate a name here, e.g., a hashed date */,
description: undefined /* STRING */,
thingTemplateName: "Timer" /* THINGTEMPLATENAME */,
tags: undefined /* TAGS */,
});
//get configuration table of the timer
var configuration = Things["newTimer"].GetConfigurationTable({
tableName: "Settings" /* STRING */
});
var row = configuration.getRow(0);
row.SetStringValue("updateRate", "300000"); // set updateRate here
row.SetBooleanValue("enabled", true); // enable this timer
row.SetStringValue("runAsUser", "Administrator"); // sets the user for this timer
//apply the configuration table
Things["newTimer"].SetConfigurationTable({
configurationTable: configuration /* INFOTABLE */,
persistent: true /* BOOLEAN */,
tableName: "Settings" /* STRING */
});
And don't forget to delete this timer in the subscription where you implement the "clean" logic:
Resources["EntityServices"].DeleteThing({
name: "newTimer"
});