About JSON

dashdash supports JSON as the standard format to exchange data with other online services.

Let’s quickly cover what it is, why it is useful, and how you can use it in dashdash.

What’s JSON?
JSON (JavaScript Object Notation) is an open standard file format that is used to transmit text and numbers in pairs or arrays of values. It was derived from JavaScript, but is language-independent. As a spreadsheet user, you might compare it to a .csv-file.

Why is JSON useful?
JSON is already very common and it’s developing into the standard data type to exchange information online. If you want to access an API of another service and grab or send data, JSON is the format that lets you talk.

How can I use JSON in dashdash?
You use JSON in dashdash to grab or send data with GET and POST. Then you can organize the specific data you want to use into the cells of the spreadsheet with PARSE.

Text and JSON are very flexible, as you can put pretty much whatever you want in them - characters, numbers, punctuation, etc. We also need to tell the system exactly where a text or JSON value starts and ends, usually with delimiter characters.

But if we use the same characters inside the text or JSON, we’ll confuse the system.

There are two options to solve this:

  1. Pick from a delimiter that isn’t used inside your cell from different options, " or '.
  2. Escape with a special character, the backslash, \.

If you want to use a JSON {"key" : "value"} inside a formula, dashdash supports two options:

  • '{"key" : "value"}'
  • "{\"key\" : \"value\"}"

Similarly, if you want to write a text Kryptonite "kills" Superman inside a formula, dashdash supports the options:

  • 'Kryptonite "kills" Superman'
  • "Kryptonite \"kills\" Superman"

In both cases, the first option uses single quotes to enclose the data, and then we can use the double quotes inside it without causing the system to get confused with where it starts and where it ends. The second option uses the backslash to warn the system that the next character is just a piece of data, not a delimiter.

Note: Because the backslash is a reserved character, if you want to use it within your text or JSON you need to escape it, with a double backslash \\.

Very important: If you include smart quotation marks : ‘ ’ “ ”, dashdash will convert them to neutral or dumb quotation marks: ’ ’ " ".