I have a JSON list of emails. How do I turn it into a single CSV column?
Paste the list and choose 'JSON to CSV'. An array of simple values, rather than objects, is written as one column headed value, one email per row. If your mailing tool expects a different header such as email, change the word value at the top of the file.
The example: two emails in an array
Your developer, or a signup form export, gave you a list like this:
["a@example.com","b@example.com"]
After conversion the tool produced this file, with a note saying the input is an array of simple values, so it was written as one column named value:
value
a@example.com
b@example.com
The summary reported two rows in one column. The emails themselves are unchanged, and nothing in them needed quoting.
Why 'value' of all names?
Normally an array of objects becomes a table whose column names come from the object keys, such as name and email. A simple value has no key, so the tool needs a generic column name and uses value. That name means nothing to a mailing tool, so it is best to change it.
Steps
- Open the CSV and JSON converter and choose 'JSON to CSV'.
- Paste the whole array, from [ to ].
- Copy the output into a text editor or spreadsheet and change the first line from value to the header your mailing tool asks for, such as email.
- Save the file as CSV and upload it.
A quicker route if you want the name from the start: turn the list into objects by hand, like {"email": "a@example.com"}, and the column is headed email directly. With a long list, though, editing one line of the output is easier.
When the tool refuses the list
We tried a list whose first item was an email string and whose second was an object with an email key. The tool refused with: 'Item 2 of the array is an object while the items before it are a simple value.' There is no single right way to put both into a table: should the column be value or email? Rather than guess, the tool names the offending item so you can make the list consistent.
Cleaning the list before upload
- The tool does not remove duplicate emails or check that they are valid. If the list was gathered from more than one source, remove repeats with the Duplicate-line remover before uploading.
- The Excel formula protection leaves an ordinary email alone, but it adds a ' to any value starting with =, +, - or @.
- If the list has Arabic names beside the emails, keep the BOM option ticked so Excel opens the file with the letters intact.
Common questions
Does the same approach work for a list of phone numbers?
Yes, any array of simple values becomes one column. Just watch for the ' added to text numbers that start with +.
Can I make the header email inside the tool?
No, value is fixed for this shape. Change it in the file after converting.
What if I untick 'First row holds column names'?
The file is written without the value line and starts straight with the first email.
