How to check if a JSON response element is NULL
Posted: Tue Nov 15, 2016 8:45 am
Hi all,
I have a VL Web application where I am getting the response back from a JSON request. It is possible for an element to have a value of null. In my RDMLX i am extracting the element with the following code:
#uUserDetails.upUserTitle := #Root<'title'>.AsString
When the value of #Root<'title'> is null, I get the following error:
Fatal Error:
{} can't be converted into a string
I am trying to condition my code to catch the null value. There is no intrinsic method isNull available on the element (#Root<'title'>.IsNull). I have also tried using:
if_ref com(#Root<'title'>) Is(*NULL)
But this evaluates to false. How can I test if the value of the element is null?
David
I have a VL Web application where I am getting the response back from a JSON request. It is possible for an element to have a value of null. In my RDMLX i am extracting the element with the following code:
#uUserDetails.upUserTitle := #Root<'title'>.AsString
When the value of #Root<'title'> is null, I get the following error:
Fatal Error:
{} can't be converted into a string
I am trying to condition my code to catch the null value. There is no intrinsic method isNull available on the element (#Root<'title'>.IsNull). I have also tried using:
if_ref com(#Root<'title'>) Is(*NULL)
But this evaluates to false. How can I test if the value of the element is null?
David