Data storage with CSV, JSON, or something else?

Hello community and fellow enthusiasts,

I decided to start a personal project to challenge my novice Shortcuts skills. Briefly, I want to create a plaintext mini journal that parses and stores quick snippets of user provided text.

I have played around with both CSV and Data Jar as solutions to store plaintext values.

My intent is to build two shortcuts. One to accept user input and store data. The other will retrieve data and allow the user to read and filter their journal data.

My question to the group is, what storage method is optimal? I’m a novice when it comes to programming, and I know CSV and JSON (from Data Jar stores) have trade-offs. I’m not knowledgeable enough to know better.

I think this will be a fun project that will push my skills to their limit.

I’d love to hear anyone who has suggestions about the best method to store the data.

Many thanks!

What do you want to do with the information once you have it stored? Knowing the sorts of ways you want to process, manipulate and interrogate the data is a good starting point.

Also, do you want to access it in more than one place?

What would you want to be able to do in terms of backing up the data?

Do you plan to use plain text with or without any sort of markup formatting?

Do you want to keep an meta data outside the content?

Have you looked at any journalling apps?

Shortcuts sees JSON formatted text as a dictionary and has lots of support for quickly reading values from it.

There’s no first-party support for manipulating CSV files so you’d have to write your own with Shortcuts.

1 Like

Good questions all around.

My endgame is to keep a simple, lightweight text-based journal that I can search and filter results as needed.

I’ve tried the big name commercial options which are all great. I’m more looking to challenge myself.

The data and metadata I want to collect would be dates and text entries. Nothing major or as involved as commercial journaling software. No locations or images, etc. Right now I plan to store a key/row number, timestamp, ID, entry, tags, and year, month, and date added.

For storage and backup, I’m thinking of using Data Jar if I go with JSON and backing up through the app. Maybe the developer will offer up a way to automate backups? That’d be cool. I also thought of using Dropbox to hold journal data in a CSV file.

As for access, I mostly will use iOS/iPadOS devices.

I haven’t thought out how to handle formatting text. I probably should. Right now I’m seeking advice how the optimally handle data storage for my small use case scenario.

Thanks for the thought-provoking questions and helping me get this thing straight in my mind. I am very grateful for your help.

Hello and thanks.

I stumbled upon Apple’s Shortcut Guide last night. It was very helpful. I was able to build a JSON dataset from a test dictionary I have stored in Data Jar.

One thing I noticeD is missing (or maybe I don’t know where to look) is native tools to filter dictionaries in Shortcuts.

I was thinking of delving into Scriptable, but I don’t know jack about JavaScript or how to get started with Scriptable. I can tell it’s powerful, but the documentation and examples haven’t been useful to me as a novice.

I’m leaning toward JSON because if appears more flexible than CSVs.

Have you thought about any of the more granular details? What sorts of filtering/searching, any sorting, etc. against specific data, content, some set of meta data, or even all meta data and content?

For example dumping everything into a single JSON/Dictionary object in Data Jar might mean a lot of complicated parsing and filtering if you wanted to search by tag for example.

Similarly flat files and file based searching might struggle to easily pick data out by tags *only*

Creating the entries in an app like (for example) Day One or Drafts which have functionality built-in around tags might be ideally suited to that sort of use.

Understanding what the future data use is in a bit more detail Could well help you in making the best selection.

What would be the purpose of the key/row number?

Why would you need to store a timestamp, a date, a year, and a month? Wouldn’t timestamp be sufficient?

Just remember that Data Jar can store files too. Potentially this could lead users to inadvertently filled up a lot of space with automated backups. That ay be why Simon’s not added that yet; or just because it is still a new app :laughing:

The reason I asked was to understand how you might plan to enter the content. If perhaps you might go via something other than a basic text entry field and use an app for example, that would affect what data storage options are accessible.

“Mostly” or exclusively? Knowing everywhere you want to enter and access from (potentially different activities) can affect what storage options are viable.

If you wanted to access via any web browser for example, storing data in a more siloed Apple hosted data store might make things difficult to impossible. Putting it in Dropbox, a Google sheet or Airtable would make this far more accessible.