API: Store Form Data & Text Offline
Save form data or other text to a .csv or .txt file stored locally in Kiosk Pro's Documents folder.
Resulting files can be accessed directly on the device by a locally stored HTML page, manually transferred to a computer, or retrieved remotely through Dropbox Sync. Files can also be managed using the Manage Local Files API.
- Sample code to run within the app and download for integration into your own project is available here.
- App Settings
- Storage of resulting data in Kiosk Pro's Documents folder
- Due to sandboxing in iOS/iPadOS, Kiosk Pro is unable to store local files outside of its own Documents folder.
Triggers via API Functions
Save Data to Local File
This function saves data to a file stored locally in Kiosk Pro's documents folder.
The filepath defined as a parameter to this call is relative to the main Kiosk Pro Documents folder (not the page calling the function if that page is also stored locally). If the file exists, Kiosk Pro will add data to the existing file in a new line. Otherwise, a new file will be created.
CSV (comma-separated value) is a standard format compatible with most spreadsheet software, including Microsoft Excel, and is often used as a format for uploading contact data to online databases. When using this format, each cell within a line must be delineated by a comma. Entries can also be saved to a plain text (.txt) file.
Kiosk Pro saves the contents of each function call as a new line in the file. If you need to enter multiple lines of data in a single call, the strings can be separated by 'LF', which will manually start a new row.
More information on how to sync the resulting .csv file remotely back to a Dropbox account if you are using our Plus or Enterprise versions is available here.
writeToFile(fileName, fileData, callback);
|Callback return values||success - if defined, the function successfully wrote data to the local file named|
- Added in version 1.1.1