http://coldfusion.com logo
#cfml-general
Title
# cfml-general
c

Cavan Vannice

02/15/2022, 8:24 PM
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

Daniel Mejia

02/15/2022, 8:35 PM
For ACF yes
NullValue() for lucee
👍 1
Are you on older version of ACF?
c

Cavan Vannice

02/15/2022, 8:36 PM
On 2021
d

Daniel Mejia

02/15/2022, 8:36 PM
null keyword should work then
m

Myka Forrest

02/15/2022, 8:37 PM
Does ACF2021 have an option to turn null off in the admin?
c

Cavan Vannice

02/15/2022, 8:38 PM
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

Daniel Mejia

02/15/2022, 8:39 PM
That sucks
By the way it should work. Are you declaring
this.enableNullSupport = true;
in a function of your Application.cfc?
c

Cavan Vannice

02/15/2022, 8:52 PM
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

Daniel Mejia

02/15/2022, 8:54 PM
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
2 Views