I'm having trouble passing a NULL value in structA...
# cfml-general
c
I'm having trouble passing a NULL value in structAppend. This is what I'm submitting
structAppend(key,{"field": null});
and it gives me
Variable NULL is undefined.
I am trying to get
"field": null
I tried enabling NULL at the application level, it didn't work. Any help would be appreciated, thanks.
Found my own answer via @ben
javaCast( "null", 0 )
Seems to be the solution.
d
For ACF yes
NullValue() for lucee
👍 1
Are you on older version of ACF?
c
On 2021
d
null keyword should work then
m
Does ACF2021 have an option to turn null off in the admin?
c
It does, but you can also turn it on at the application level. That is what I tried, but it didn't solve my issue.
d
That sucks
By the way it should work. Are you declaring
this.enableNullSupport = true;
in a function of your Application.cfc?
c
I did it in the
onAppInit
function of Coldbox and then reinit the app. I could probable just set it server wide, but the javacast seems to have resolved it
d
that's it. set it outside and above that init function. set it next to your session management settings or this.name settings.
👍 1
It should be listed in the docs here: https://cfdocs.org/application-cfc but its not.
I submitted a PR for cfdocs to include that setting.
👍 1
1