yves.deveyrac@etrali;com
unread,Mar 23, 2015, 12:23:11 PM3/23/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to suppor...@runmyprocess.com
Hello,
I use the following script to load a collection.
<#assign my_object>
{
« field_1":"${text_variable_1?default("")}",
"field_2": ${number_variable?default("")}
}
</#assign>
${save_object(my_object,"collection_name")}
When the value of the variable is not defined / empty, the script works fine for fiedl_1 but not for field_2. The error is ‘JSONException: Malformed object’.
If I use "field_2":${number_variable?default("") ?number}, the error is ‘Expecting a number here, found: ‘.
What is the correct script so that an empty variable doesn’t create an error when loading a number in a collection ?
Regards
Yves