Forum Discussion
adam_gataev - you were very close - try this
.map((elem, idx, arr) =>
{
"fieldA": elem.fieldA,
"fieldB": [
{
"fieldC1": elem.fieldC1,
"fieldC2": elem.fieldC2
}
]
.concat(
elem.get('fieldD1') > ''
? [
{
"fieldD1": elem.fieldD1,
"fieldD2": elem.fieldD2
}
]
: []
)
.concat(
elem.get('fieldE1') > ''
? [
{
"fieldE1": elem.fieldE1,
"fieldE2": elem.fieldE2
}
]
: []
)
}
)
Hope this helps!
- arodriguez3 years agoEmployee
Yes, my intention is to use the origin system API endpoints.