Member since
04-20-2023
2
Posts
0
Kudos Received
0
Solutions
04-20-2023
09:20 AM
Thanks for tagging them! ill be waiting for that answer, have a nice day!
... View more
04-20-2023
07:27 AM
Ive got an input that will have different IDs: {
"title": "Screening Questions - Questions Test ID 48670",
"description": "",
"type": "object",
"properties": {
"15": {
"type": "string",
"title": "<img src=\"data:image/png;base64,iVBORw0KGgoAAA ANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4 //8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU 5ErkJggg==\" alt=\"Red dot\" />",
"description": ""
},
"17": {
"type": "string",
"title": "Test ID",
"description": ""
},
"18": {
"type": "string",
"title": "Test ID",
"description": ""
},
"19": {
"type": "string",
"title": "asdsadsad",
"description": ""
}
},
"dependencies": [],
"required": [],
"av:propertyOrder": [
15,
17,
18,
19
]
} And I'm changing it with the following jolt: [
{
"operation": "shift",
"spec": {
"definitions": {
"optionSet_*": "definitions.&(0,1)",
"*": "&"
},
"*": "&"
}
}, {
"operation": "shift",
"spec": {
"properties": {
"*": {
// simple match. Put the value '4' in the output under the "Rating" field
"title": "Questions[&1].question",
"type": {
"number": {
"#select": "Questions[&3].type"
},
"string": {
"#textarea": "Questions[&3].type"
},
"array": {
"#multiselect": "Questions[&3].type"
}
},
"$": "Questions[&1].id"
}
},
"dependencies": {
"*": {
// simple match. Put the value '4' in the output under the "Rating" field
"switch": {
"*": {
"then": {
"properties": {
"*": {
"title": "Questions[&1].question",
"type": {
"number": {
"#select": "Questions[&3].type"
},
"string": {
"#textarea": "Questions[&3].type"
},
"array": {
"#multiselect": "Questions[&3].type"
}
},
"$": "Questions[&1].id"
}
},
"required": {
"*": {
"#true": "Questions[@(1)].required"
}
}
}
}
}
}
},
"definitions": {
"*": {
"anyOf": {
"*": {
"title": "Questions[&3].options[#2].label",
"const": "Questions[&3].options[#2].value"
}
}
}
},
"required": {
"*": {
"#true": "Questions[@(1)].required"
}
}
}
},
{
"operation": "remove",
"spec": {
"Questions": {
"0": ""
}
}
},
{
"operation": "shift",
"spec": {
"Questions": "",
"*": "&"
}
}
] which leaves me with the following: [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, {
"id" : "15",
"question" : "<img src=\"data:image/png;base64,iVBORw0KGgoAAA ANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4 //8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU 5ErkJggg==\" alt=\"Red dot\" />",
"type" : "textarea"
}, null, {
"id" : "17",
"question" : "Test ID",
"type" : "textarea"
}, {
"id" : "18",
"question" : "Test ID",
"type" : "textarea"
}, {
"id" : "19",
"question" : "asdsadsad",
"type" : "textarea"
} ] Any idea how to remove those pesky nulls? Tried with the good ol recursivelysquashnulls but it wont do it... thanks in advance!
... View more
Labels:
- Labels:
-
Apache NiFi