Using my data in another app?

Viewing 6 reply threads
  • Author
    Posts
  • August 26, 2017 at 11:45 AM #24178

    Steve Morris
    Participant

    I use tap forms regularly. I have several applications but the main one is collecting data to help me manage my diabetes. As a basic data base it is working well, especially with the enhanced search. The one thing I wish I could do easier is share data outside of tap forms. For example sometimes I want to send some data to my doctor. Also I use the Pythonista app a lot. Pythonista is Python integrated with ios so i write a lot of scripts. I would like to write Python scripts to analyze my diabetes data. To do that I would like to send the data I just entered to a script which then looks through recent history and gives me advice. Python is heavily used in the science world for numerical analysis. Pythonista includes the core data processing and plotting libraries used for this (Numpy etc.) I would like to use this capability to analyze the data I collect in Tap Forms. The two apps seems like a perfect fit to me.The best iOS database app connected to the only usefull and fully functional scripting language that runs on iOS.

    Tap Forms is close. I have saved a cvs file down in the files menu then shared it. (I can put my Pythinista scripts in the Apple Share menu.) However in Tap Forms this process is so tedious. I counted and the process of sharing csv data has seven steps and that doesn’t include managing the now useless files. So I did it once, plotted my blood sugar data and never did it again. It is worth doing once in a while but I want something I could do almost every time I enter data.

    However I recently noticed that that when I select a record there is a share button. I was very excited. That is only two clicks away from the record. Today I decided it was time to get back to writing some scripts. I started with my demo share script at that just captures the data. The shared data was a large tfarc file presumably containing the entire dataset. It is big enough. What the heck am I supposed to do with a tfarc file when I asked to share a specific record? This makes no sense to me. If I understand what a tfarc does it should only be shared when you are in a global context, not when you are looking at a single record.

    Major disappointment. Not what I was hoping. I still don’t have a convenient way to share data with my doctor and write scripts to help manage my diabetes. tfarc is only interesting to Tap Forms. My doctor doesn’t use Tap Forms (she can open .csv files) and I don’t know how to unpack a tfarc in in Python.

    A request. The share functionality can share more than one file at a time. It is common to share data in multiple formats for use by different apps letting the app choose between the different kind of files. For example text files could be shared as raw text, markup and html. Could Tap Forms share both a tfarc and a csv file at these share menus? That should be backwards compatible.

    Ideally there should be 3 ways to share a data set depending on were the user selects share.

    1) At the record level the shared csv should contain that record.
    2) In the search function the shared csv file should contain the selected records of the search.
    3) At the top level the shared csv file should contain the entire data set.

    Tap Forms is so close to what I need. I’m convinced that a close binding between Tap Forms and Pythonista scripting would get you a completely new source of customers. There is a whole world of scientists out there (and anyone else with large datasets to process) using Python to interact with databases.

    August 26, 2017 at 1:32 PM #24182

    Brendan
    Keymaster

    Hi Steve,

    Thanks for your detailed description of what you’re trying to accomplish with Tap Forms.

    Tap Forms is sharing the .tfarc file just for that specific record when you use it at the record details level. It was a convenient way of sharing everything there was to share about that record, including file attachments, photos, etc.

    By the way, a .tfarc file is just a zipped file which contains a data.json file. The .zip extension is renamed to .tfarc so that Tap Forms recognizes it as a Tap Forms Archive file. The data.json file has all of your data in it for all the records in the form.

    So if Pythonista can unzip the file and then process a .json document, then you could theoretically get the data that you want from that Share panel.

    It is a bit tricky deciding what type of data to share. In the case of sharing a CSV file with just one record, what about any file attachments and photos you might have in that record? Do they get ignored or do I create a separate zip file that contains all of those things? What if there are Link to Form fields in that record? Do I then export those too? The .tfarc file answere all those questions for me.

    I’m definitely interested in helping to make this process easier for you though. One possibility would be when you tap the Share button, I then ask the user what format to share the record in (CSV or Archive).

    August 26, 2017 at 5:05 PM #24184

    Steve Morris
    Participant

    Thanks. That’s not as bad as I thought. I haven’t looked but it is likely that unzip and Jason are part of the core libraries. I shouldn’t even need to download anything. I was thrown off by the file size which I think is 17k unless I am using the python shell incorrectly. I’ll unzip it and see what I find. It may be that the archive format is best for Pythonista for the same reasons you chose it. My Diabetes database is simple but that might change.

    I would definitely support sharing csv though regardless. The best test would be to share with Numbers or Excel or some other spreadsheet. I’m surprised that hasn’t been requested. That seems like another obvious matchup for Tap Forms. The user can use a spreadsheet to do things you’ll never implement because they are oddball one off requests and not worth the effort.

    And the ability of exporting a human readable format should be considered for applications like emailing records to doctors or building contractors or whatever. CSV covers a a lot of ground but it’s not for everyone. I would consider sharing an email friendly table format like HTML or something for sharing with nieve users.

    I haven’t looked. Is shareing select/sort results supported? The three useful cases to share are single record, select/sort and the full dataset.

    I’d be willing to publish a couple of simple Pythonista share utilities on the forum. Can you suggest any possibilities that might be generic enough to be interesting to other Tap Form users but still be simple to implement? Pythonista is pretty complete in what it can support in iOS (there are apps in the App Store written in Pythonista) but not all of that is available in share extensions.

    August 27, 2017 at 1:14 AM #24196

    Brendan
    Keymaster

    Hi Steve,

    There’s already the ability to email an HTML or PDF version of a record. Plus you can email a set of records in CSV format from the records list view.

    If you have a Saved Search selected, Tap Forms will export only that data, either to a Tap Forms Archive or to CSV from the records list screen.

    You can post to the Template Exchange forum if you like. That’s where all uploads from customers should go. I’m not sure how many other people use Pythonista though. I’ve never used it myself.

    August 27, 2017 at 8:45 AM #24199

    Steve Morris
    Participant

    OK that was easy. I can read and parse the zip file then find and parse the data.json file.
    pythonista parses Tap Forms file
    Questions:

    Is there any documentation on the data structure? I’m sure it will be easier to understand if I send it to my Mac and read it on a bigger screen ;-) But any pointers would be appreciated. This is a lot of data to package five pieces of content from a single record but I’m sure somewhere in the json is a simple path to the actual content.

    What’s the .blob?

    Will I be able to figure out the context of the share? Ie Is the user sharing a single record, a sorted subset or the full data set.

    How stable will the data structure be in Tap Forms updates.

    Attachments:
    You must be logged in to view attached files.
    August 27, 2017 at 9:31 AM #24201

    Steve Morris
    Participant

    When I select a sorted selection and tap the share icon there doesn’t seem to be any way to get to the Apple share functionality. That only seems to exist at the view record screen. The interface there is perfect, exactly what is needed. The user taps the share icon twice and they are in the Apple share functionality deciding which app the send it to. Could the same functionality be added to the share icon menu in other contexts? For example when the user is at the record list view or when a sort is selected?

    August 27, 2017 at 2:55 PM #24209

    Brendan
    Keymaster

    Hi Steve,

    The structure of the data.json file will change over time only in the sense that I’ll add new fields to it.

    I don’t have documentation on its structure because it was only ever meant to be read by Tap Forms. But the main content of the data will be stored within the TFFormEntry type entries. You’ll see a “value” dictionary that contains the field ID (beginning with “fld-“) and the value. The value could be a simple string, a number, an array, or a dictionary.

    .blobs are just the attachments, such as photos, file attachments, etc. If they’re not encrypted, then you can actually read the .blob files as if they were normal files. So even though it has a .blob file extension, it may actually be a PDF file, a JPEG, PDF file, etc. FYI, the .tfarc files don’t contain encrypted attachments.

    As for the Share sheet on the records list view, yes, I should have it. Not sure why I don’t. I’ll add it.

    Thanks,

    Brendan

Viewing 6 reply threads

You must be logged in to reply to this topic.