01-16-2018 12:01 PM
The output is of the above form. Here root element(Array) is of the form of an array. How do we make it of the form of an object?
To get the idea of the json form, the above is the json view of the output. In that, you can see that “d” is an array.
I want the output to be of the above form. Please do help. Thanks in advance.
01-18-2018 12:17 PM
have you tried a mapper with javascript such as outlined here:
01-18-2018 12:20 PM
or perhaps the structure snap?
01-19-2018 10:58 AM
The extend() method can be used to create objects dynamically from other objects passed in as arguments. In your case, it looks like the objects in the ‘$Array’ field do not have overlapping keys, so you can directly use the array as the arguments to extend
. However, you cannot just pass ‘$Array’ to extend()
, you need to use the spread operator to indicate that the elements of the array should be treated as the arguments to the function, like so:
{}.extend(...$Array)
The {}
part just creates an empty object for us to call extend()
on.
There are a few other examples of using the extend()
method in the community, like this one.
01-21-2018 12:35 AM
Thanks a lot… It helped…