web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Expression to map all ...
Power Automate
Unanswered

Expression to map all possible nested values

(0) ShareShare
ReportReport
Posted on by 131

 

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])

 

 

Capture.JPG

 

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

Categories:
I have the same question (0)
  • Verified answer
    v-alzhan-msft Profile Picture
    on at
    Re: Expression to map all possible nested values

    Hi @simondpalmer ,

     

    Please share the full array and explain more details about the requirement so we could take a try to make a test on it and provide a proper solution for you.

     

    I have made a test on my side to create the flow as below, does it meet your requirement?

    1.png2.png

    Best Regards,

    Alice

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • simondpalmer Profile Picture
    131 on at
    Re: Expression to map all possible nested values

    Thanks @v-alzhan-msft the flow looks like the below. "appliedCategories"s 'category1, category2, etc. I want to make separate keys from:

    Capture.JPG

    An example of a full array looks like the following:

     {
     "@odata.etag": "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAZCc=\"",
     "planId": "BGdKsoj4AUuCWxQRd5DHAmUAEh6b",
     "bucketId": "VJ0R4ZZkZU-FrA9eDMA7imUAMA4S",
     "title": "RE: 19510 and 19520 Jamboree Rd - pedestrian bridge between buildings",
     "orderHint": "8586126197660276906",
     "assigneePriority": "8586126197660276906",
     "percentComplete": 100,
     "startDateTime": null,
     "createdDateTime": "2020-05-09T01:18:39.4498901Z",
     "dueDateTime": "2020-05-09T07:00:00Z",
     "hasDescription": true,
     "previewType": "automatic",
     "completedDateTime": "2020-05-12T18:55:32.1597893Z",
     "referenceCount": 0,
     "checklistItemCount": 0,
     "activeChecklistItemCount": 0,
     "conversationThreadId": null,
     "id": "9yqGCZJlxkG3qLP_juN3fmUAC41b",
     "createdBy": {
     "user": {
     "displayName": null,
     "id": "128a7b60-83ea-43d4-b228-2eb34c85f850"
     }
     },
     "completedBy": {
     "user": {
     "displayName": null,
     "id": "128a7b60-83ea-43d4-b228-2eb34c85f850"
     }
     },
     "appliedCategories": {
     "category1": true,
     "category2": true,
     "category3": true,
     "category4": true,
     "category5": true,
     "category6": true
     },
     "assignments": {
     "128a7b60-83ea-43d4-b228-2eb34c85f850": {
     "@odata.type": "#microsoft.graph.plannerAssignment",
     "assignedDateTime": "2020-05-09T01:18:39.4498901Z",
     "orderHint": "8586126198261058635P7",
     "assignedBy": {
     "user": {
     "displayName": null,
     "id": "128a7b60-83ea-43d4-b228-2eb34c85f850"
     }
     }
     }
     },
     "_assignments": [
     {
     "userId": "128a7b60-83ea-43d4-b228-2eb34c85f850",
     "value": {
     "@odata.type": "#microsoft.graph.plannerAssignment",
     "assignedDateTime": "2020-05-09T01:18:39.4498901Z",
     "orderHint": "8586126198261058635P7",
     "assignedBy": {
     "user": {
     "displayName": null,
     "id": "128a7b60-83ea-43d4-b228-2eb34c85f850"
     }
     }
     }
     }
     ]
     },

     

     

    Capture02.JPG

  • v-alzhan-msft Profile Picture
    on at
    Re: Expression to map all possible nested values

    Hi @simondpalmer ,

     

    Please take a try to refer to my steps to create the flow.

     

    Best Regards,

    Alice

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • simondpalmer Profile Picture
    131 on at
    Re: Expression to map all possible nested values

    Thank you so much for your help Alice,

     

    So I put it all together. List Tasks > Parse JSON (appliedCategories have specific properties) > Select those values from Parse JSON. End product below.

    Capture.JPG

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard