
I need to send a JSON to a connector (in this case Plumsail - but what the connector is doesn't matter). The problem is that the json is complex. I have my array done at the parent level but now I need to loop through the array and append a nested array to it. So far I have been using select actions to create my json from multiple sources. Using select actions is really quick. But the only way I can think to append in the nested array is to do a traditional loop which is slow.
My desired output is this:
{ "Project": [
{
"Name": "Testing 1",
"PageBreak": "",
"Dates": "2020-10-22",
"Status": "Completed",
"Purpose": "To do blah",
"QI": "QI stuff",
"DivisionOwner": "Finance",
"Percent": 0.10,
"Lead": "Jasper Carrot",
"Category": "Comedy",
"IPOReadiness": "Entertainment",
"Comments": [
{
"Accomplishments": "None",
"Actions": "Do nothing",
"Risks": "Might catch fire",
"Status": "Juggling",
"Complete": 0.10,
"Date": "2012-04-21T18:25:43-05:00",
"Who": "Darth Vader"
},
{
"Accomplishments": "This",
"Actions": "Shoot down star destroyer",
"Risks": "Might get shot down myself",
"Status": "Arming",
"Complete": 0.35,
"Date": "2022-12-22T18:25:43-05:00",
"Who": "Luke Skywalker"
}
],
"Milestones": [
{
"Description": "Milestone A",
"Dependencies": "Dependency A/Dependency B",
"Status": "Pending",
"CompletionDate": "2022-12-31T18:25:43-05:00"
},
{
"Description": "Milestone B",
"Dependencies": "Dependency A/Dependency F",
"Status": "Completed",
"CompletionDate": "2022-12-01T18:25:43-05:00"
}
]
},
{
"Name": "Testing 2",
"PageBreak": "",
"Dates": "2020-12-22",
"Status": "Open",
"Purpose": "do something",
"QI": "QI blah",
"DivisionOwner": "CSD",
"Percent": 0.50,
"Lead": "Mickey Moose",
"Category": "Action",
"IPOReadiness": "Drama",
"Comments": [],
"Milestones": []
}
]}
I'm at the stage where I need to get the comments and the milestones array and append them to the appropriate project. For the comments I plan to do a loop, then this is where I'm stuck. Each project, I need to filter the comments and append that array to the main json. Suggestions?