Jarvish | 2022-07-11 10:23:59 UTC | #1
Hi All,
How can i get the null in my data action response?
Currently if there are any null values, its not showing the array list. it simply showing the value which is not null.
I need to have the number of values for array even if their values are null.
Jerome.Saint-Marc | 2022-07-11 13:03:35 UTC | #2
Hello,
Defining null or string type for your array, in your output contract, might help you. See this other post
Regards,
Jarvish | 2022-07-11 13:20:15 UTC | #3
Thanks For the input, I tried that already.
{ "translationMap": { "eventName": "$.entities[].webEvent.eventName", "urlValue": "$.entities[].webEvent.attributes.chatBotUrlValue.value", "urlKey": "$.entities[*].webEvent.attributes.chatBotUrlKey.value" }, "translationMapDefaults": { "eventName": "\"UNKNOWN\"", "urlValue": "\"UNKNOWN\"", "urlKey": "\"UNKNOWN\"" }, "successTemplate": "#set ( $quo = $esc.quote ) #set($newNull = \"${quo}EMPTY${quo}\"){\"eventName\":${eventName},\"urlKey\":${urlKey.replace(\"null\", $newNull)}, \"urlValue\":${urlValue.replace(\"null\", $newNull)}}" }
But it doesn't sees to be working.
Regards,
Jerome.Saint-Marc | 2022-07-11 14:01:32 UTC | #4
Try defining string and null in your Output Contract array (as described in the other post). And in this case, you should not have to do a string replace of null. Null should become a NOT_SET array entry (from Architect perspective).
Regards,
system | 2022-08-11 14:02:14 UTC | #5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 15457