I am using Select Data Operation to map values from Plan tasks. I am having trouble mapping the array "appliedCategories" as I want to create individual key and mapped values based on the nested values ("category1", "category2", "category3", "category4", "category5", "category6"). As you can see below (copy of body minus all the other fields for clarity) each nested value doesn't come through if it is false. However, I want a "null" value if it is false regardless.
{
},
"appliedCategories": {
"category2": true
},
},
{
},
"appliedCategories": {},
},
{
},
"appliedCategories": {
"category1": true
},
},
},
"appliedCategories": {
"category1": true,
"category2": true,
"category3": true,
"category4": true,
"category5": true,
"category6": true
},
]
},
I used the following:
if(empty(item()?['appliedCategories']),null,item()?['appliedCategories'])
but that doesn't apply to nested boolean values. So i created individual keys (for "category1", etc.) tried the below:
if(empty(item()?['appliedCategories'],[0]),null,item()?['appliedCategories'],[0])

But this doesn't work. Any help would be great