Hi,
I've got this kind of data:


--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/c5cd8a8e-e8a9-4ac8-9b0f-4bde05e9a13fo%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to openr...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/5dc84943-9b33-d05a-e120-b68640cb5338%40antonin.delpeuch.eu.
> I've seen this solution
> (https://groups.google.com/forum/#!searchin/openrefine/json$20templating%7Csort:date/openrefine/56MIeWHZiKY/fXexf3t5rTQJ
> <https://groups.google.com/forum/#!searchin/openrefine/json$20templating%7Csort:date/openrefine/56MIeWHZiKY/fXexf3t5rTQJ>)
> so I created a new column base on "person name" with
>
> if(isNonBlank(value), '{ "name": "' + value + '", "viafId": "' +
> cells['viafId'].value + '", "wikidataId": "' +
> cells['wikidataId'].value + '", "role": "' + cells['role'].value
> + '" }', null)
>
> but with my data it takes just the first line and not the
> second, I think because in the second case the "wikidataId" is
> null. I think I need to insert another logic for the viafId and
> the WikidataId.
if(isNonBlank(value), '{ "name": "' + value.toString() + '", "viafId": "' + cells['viafId'].value.toString() + '", "wikidataId": "' + cells['wikidataId'].value.toString() + '", "role": "' + cells['role'].value.toString() + '" }', null)"person": [
{
"name": "Alighieri, Dante",
"viafId": "893",
"wikidataId": "Q3939",
"role": "creator"
},
{
"name": "Other",
"viafId": "566",
"wikidataId": "",
"role": "contributor"
}
]