I have been trying to manually upload the JSON into BigQuery, but I get the following error message.
Error while reading data, error message: JSON parsing error in row starting at position 0: Repeated field must be imported as a JSON array. Field: custom_fields.value.
I already converted the file into newline delimited JSON, so that is not the problem. When looking at the custom_field.value from the error I get this:
$ cat convert2working.json | jq .custom_fields[].value
0
"Basics of information security\n"
"2021"
The problem seems to be that the custom_fields.value has different data types.
How can I "homogenize" those data types? or do you have another solution. I would prefer to stay in javascript
Here is a shortened version of my JSON code:
{
"id": "example",
"custom_fields": [
{
"id": "example",
"name": "Interval",
"type": "drop_down",
"type_config": {
"default": 0,
"placeholder": null,
"options": [
{
"id": "example",
"name": "yearly",
"color": null,
"orderindex": 0
}
]
},
"date_created": "1611228211303",
"hide_from_guests": false,
"value": 0,
"required": false
},
{
"id": "example",
"name": "Description",
"type": "text",
"type_config": {},
"date_created": "1611228263444",
"hide_from_guests": false,
"value": "Basics of information security\n",
"required": false
},
{
"id": "example",
"name": "Year",
"type": "number",
"type_config": {},
"date_created": "1611228275285",
"hide_from_guests": false,
"value": "2021",
"required": false
}
]
}