gergnnud

JSONSetElement - Object and array

Discussion created by gergnnud on Oct 22, 2018
Latest reply on Oct 24, 2018 by gergnnud

Can anybody please enlighten me on why this does not work?

 

Evaluated from Table1 as a calculation.

 

JSONSetElement ( "" ; "contactNumbers" ; Substitute ( List ( Table2::JSON ) ;  "}¶{" ; "},{" ) ; JSONArray )

 

Where Table2::JSON =

JSONSetElement ( "{}" ;

[ "number" ; Table2::PhoneNumber ; JSONString ] ;

[ "type" ; Table2::PhoneType ; JSONString ]

)

and Substitute ( List ( Table2::JSON ) ;  "}¶{" ; "},{" ) is a valid JSON string?

 

instead returns:

 

{"contactNumbers":[]}

 

What am I missing?

Outcomes