cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KranthiTupakula
Responsive Resident
Responsive Resident

How to read nodes into an array variable?

Hi,

 

I have the following as output to my compose action and i want to read title from this. 

Any help would be appreciated.

2020-08-07_12-21-04.png

1 ACCEPTED SOLUTION

Accepted Solutions

I found two issues trying to parse this as JSON.

1) Although its JSON readable it isn't in the form of an array.  That can be fixed with a simple replace of changing '"checklist": {' into

'"checklist": [{'. And then changing the final '} } } } }' into  '} } } } ] }' .  You can then read all the properties as dynamic content.

2) But then the problem is that each object in the array has a different name like, "40905", "45496", etc.  That means that although its an array you can do an Apply to each on it.  I'm not sure how to fix that unless you know what those names will be.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User III
Dual Super User III

Do a Parse JSON on the checklist in the Compose object.  Then you can use a for each to get the titles out of each item in the array.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks for the response @Pstork1 

I could not parse the Json as it is not a proper JSON.

Here is the JSON , let me know if you are lucky to parse it.

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#planner/tasks('0qnYpto0bEK38A1dXrg0zmUAOsv3')/details/$en...",
"@odata.etag": "W/\"JzEtVGFza0RldGFpbHMgQEBAQEBAQEBAQEBAQEBAaCc=\"",
"description": "test notes 3",
"previewType": "noPreview",
"id": "0qnYpto0bEK38A1dXrg0zmUAOsv3",
"references": {},
"checklist": {
"14295": {
"@odata.type": "#microsoft.graph.plannerChecklistItem",
"isChecked": false,
"title": "test 2",
"orderHint": "8586048793Y}",
"lastModifiedDateTime": "2020-08-06T15:25:38.7313989Z",
"lastModifiedBy": {
"user": {
"displayName": null,
"id": "79bc22b9-957d-4269-bffa-eb3d99bec7d7"
}
}
},
"40905": {
"@odata.type": "#microsoft.graph.plannerChecklistItem",
"isChecked": false,
"title": "test 4",
"orderHint": "8586048793=r",
"lastModifiedDateTime": "2020-08-06T15:25:42.7160663Z",
"lastModifiedBy": {
"user": {
"displayName": null,
"id": "79bc22b9-957d-4269-bffa-eb3d99bec7d7"
}
}
},
"45496": {
"@odata.type": "#microsoft.graph.plannerChecklistItem",
"isChecked": false,
"title": "test 3",
"orderHint": "8586048793Ff",
"lastModifiedDateTime": "2020-08-06T15:25:40.6340475Z",
"lastModifiedBy": {
"user": {
"displayName": null,
"id": "79bc22b9-957d-4269-bffa-eb3d99bec7d7"
}
}
},
"64128": {
"@odata.type": "#microsoft.graph.plannerChecklistItem",
"isChecked": false,
"title": "test 1",
"orderHint": "8586048794100784473PO",
"lastModifiedDateTime": "2020-08-06T15:25:35.4147555Z",
"lastModifiedBy": {
"user": {
"displayName": null,
"id": "79bc22b9-957d-4269-bffa-eb3d99bec7d7"
}
}
}
}
}

Hi @KranthiTupakula 

You can parse the JSON, I had used your sample JSON, assigned to a string variable and then parsed using the action 'Parse JSON'

sudharsan1985_0-1596860810548.png

Click on the 'Generate from sample' and paste your JSON for generating the schema. It should work and it worked for me and after that, you can use the 'Apply to each' and get the values.

 

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

I found two issues trying to parse this as JSON.

1) Although its JSON readable it isn't in the form of an array.  That can be fixed with a simple replace of changing '"checklist": {' into

'"checklist": [{'. And then changing the final '} } } } }' into  '} } } } ] }' .  You can then read all the properties as dynamic content.

2) But then the problem is that each object in the array has a different name like, "40905", "45496", etc.  That means that although its an array you can do an Apply to each on it.  I'm not sure how to fix that unless you know what those names will be.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (47,601)