Search HoldMyTwist

Browse all posts

Create JSON in Make without breaking quoted text

Make Free with Typed Fields creates JSON. Don't forget to keep the quotes, check your numbers, and look at your text before you use it.

A brass packing station placing an aqua notebook and matching cubes into a navy glass box

Quotation mark product name is problem for hand-made JSON. In this exercise, you are passing an item name and number quantity to Make's Create JSON module. This module will create the JSON text (not pass to another app).

Before you start

First, you must have Make account. You can create Make Free account (opens in a new tab) or login. These in-built modules don't require any app integration. Let's keep this practice scenario Inactive. Use Run once


OK, we need Make account. You can create your Make Free account (opens in a new tab) or login. These in-built modules do not require any application integration. Let's set this practice scenario as Inactive. Use Run once

1. Define the fields

English Make task start in "Scenarios" "Create scenario" top left is called "Create JSON practice". The big plus is "JSON > Create JSON". "Create a data structure" it's called "Product JSON practice". In "Generate" "Content type" still "JSON" Below the sample. "Sample data" put the example. Now the second "Generate" has "Item" type "text" and "Quantity" type "number". Save data structure.

Text to copy

{"item":"Notebook","quantity":2}

Full Make editor with Item type text and Quantity type number in the data structure

Full Make editor with Item type text and Quantity type number in the data structure
Open full-size image

2. Enter a name containing quotes

  1. Go to module - > in the field Item type: Notebook "Pocket" (including quotes)
  2. In the field Quantity type 2 (no quotes around the number)
  3. Save the module, save the scenario (only unused output message is possible to save anyway in this practice)

Full Make editor with item Notebook Pocket in quotation marks and quantity 2

Full Make editor with item Notebook Pocket in quotation marks and quantity 2
Open full-size image

Watch out

The sample provides you with a field and type definition. It doesn't provide you with values for each run. You have to enter or map values into Create JSON for each run. The number 2 and text "2" could mean different things to the app you are sending it to.

3. Check the generated JSON

Click on "Run once" Next, if you get the same unused output warning that I showed earlier, click "Run anyway" Once it finishes executing, click on the result bubble (the one above the module). Inside the module's Output you should see the field called "JSON string". You should see the value of "JSON string" matches the one that is printed below, as the expected result.

Text to copy

{"item":"Notebook \"Pocket\"","quantity":2}

Full Make editor showing the generated JSON string with escaped quotation marks

Full Make editor showing the generated JSON string with escaped quotation marks
Open full-size image

The backslashes escape quotes inside the name. Quantity is still an unquoted number. Use this module's JSON string token for getting JSON text in any later module. Don't re-build your object with each field.

If the output has the wrong values

Look at the types of field you have in your data structure and the values you are entering into the module. It's not just the sample, that doesn't change the configured input. Make sure you have some representative name and punctuation in your practice data and that you know the target's required field names before you wire a real action to it. If you have a workflow you're doing more than once, use Make for this step. If it's a one-off, a spreadsheet or text editor might be easier. Start with Make Free (opens in a new tab). Be aware of the Free-plan limits before scheduling any actions.

Sources: Make JSON documentation (opens in a new tab). Screenshots show Make with fictional practice data.

Share this post