To convert location village code, the parseInt().toString function I implemented is returning a NaN string when the value is null. Can you please modify so that it returns a blank value ''.
See this run and search for oscar_number01E6AT3AEHWY668FTHT06EAB2K.
Data provided by Oscar (ON: 01E6AT3AEHWY668FTHT06EAB2K / extId: ) : {
"global_id": "01E6AT3AEHWY668FTHT06EAB2K",
"location_current_village_code": "",
Data provided to Primero `upsertCase`: {
"remote": true,
"oscar_number": "01E6AT3AEHWY668FTHT06EAB2K",
"case_id": null,
"child": {
"case_id": "",
"oscar_number": "01E6AT3AEHWY668FTHT06EAB2K",
"location_current": "NaN",
https://github.com/OpenFn/unicef-cambodia/blob/fae432ab97e3e596226dfadef8656f24d53080ae/jobs/f2-j2-upsertCasesToPrimero.js#L327-L330
To convert location village code, the
parseInt().toString
function I implemented is returning aNaN
string when the value is null. Can you please modify so that it returns a blank value''
.See this run and search for
oscar_number
01E6AT3AEHWY668FTHT06EAB2K
.