I'm working in a Buildfire app, and, after reading the dataStore docs and trying the example codes in a the javascript tab in a custom plugin, I still have some questions:
- How can I write field in the dataStore?
- How can I import an existing csv database to the dataStore?
- How can I connect these records to different apps?
thanks in advance
the official documentation can be found here
It is very important that you understand that the Datastore is behind BuildFire's CMS. Which means that it is read/write on the control side but read-only on the widget side. If you need to write on the widget side (mobile side) then you may want to consider using UserData or PublicData
You can import a CSV file into Datastore using HTML5 fileReader (also a good read https://www.html5rocks.com/en/tutorials/file/dndfiles/) and Datastore Bulk Insert. You simply open the file, read line by line or use a CSV to JSON plugin to convert each line in your CSV file to a JSON object. Then use datastore
builkInsert
to push the records into DatastoreHow can you connect this data to multiple apps? You cannot. Since Datastore is a shared resource it is heavily segmented our so no data bleed may occur. That being said. If it is the same data copied over and over. You can have a local JSON file uploaded with your plugin and you can refer to that without the need for Datastore. However, If this is an absolute necessity you can either connect to your own custom DB using any web api. Or potentially use a solution like Googles Firebase that many of BuildFire Plugin developers enjoy using