cancel
Showing results for 
Search instead for 
Did you mean: 

Convert array to object and remove empty array

Cogenics
New Contributor

Hello experts,
Can you help me on converting array to object.
Input :-
{
“abc”: [
{
“ex_1_filed_name”: “a”,
“ex_1_filed_Value”: “N”
},
{
“ex_1_filed_name”: “b”,
“ex_1_filed_value”: “Y”
},
[
{
“ex_1_filed_name”: “c”,
“ex_1_filed_value”: “d”,
“valuid”: “c”
},
{
“ex_1_filed_name”: “c”,
“ex_1_filed_value”: “e”,
“value”: “c”
}
],
[

        ],
        [

        ]
      ]

}
Expected Output :-

{
“abc”: [
{
“ex_1_filed_name”: “a”,
“ex_1_filed_Value”: “N”
},
{
“ex_1_filed_name”: “b”,
“ex_1_filed_value”: “Y”
},

          {
            "ex_1_filed_name": "c",
            "ex_1_filed_value": "d",
            "valuid": "c"
          },
          {
            "ex_1_filed_name": "c",
            "ex_1_filed_value": "e",
            "value": "c"
          }
          ]

}

1 REPLY 1

igormicev
Contributor

Hi @Cogenics,

You can check this pipeline Convert_Array_to_Object_2020_12_14.slp (4.5 KB)

/Igor