Application ID
4A47197B-AE30-FA84-FF56-0071F4010900
Expected Behavior
I would like to pull a list of objects from an external API and then be able to create a new list with a subset of the properties in the initial JSON.
When I get the JSON, it looks like this:
[
{
"contacts": [
{
"date_updated": "2020-12-18T13:38:11.809000+00:00",
"date_created": "2020-08-26T11:05:04.198000+00:00",
"integration_links": [
{
"name": "Bio",
"url": "http://XXX"
},
{
"name": "Video",
"url": "http://video.XXX"
},
{
"name": "Send Document via PandaDoc",
"url": "XXX"
}
],
"phones": [
{
"country": "GB",
"phone": "+44XXX",
"phone_formatted": "+44XXX",
"type": "mobile"
}
],
"custom.ccf_F7atO93CXpppO74qw6bZRot4J6Y4KOHXK7zVwOzkI7U": "2020-12-17",
"title": "",
"display_name": "XXX",
"created_by": "user_8ym1NFSM77aDdlFCOMjdhkPgUaX4hqfckmdkx22cWPa",
"custom.ccf_JQfEM4g49NVpBMOpetyBenCRXZJMTW9P5s3fANgOYlE": [
"//Thu...17"
],
"custom.ccf_IXfh1a89OXSkbcjAIbMeG4MXcSsoTBWJHu1HskI4Odl": "2020-12-17",
"emails": [
{
"type": "office",
"email": "XXX"
}
],
"custom.ccf_dmJMdFxvfjz3EomR7MZPB9ogp5uOElqEAc8rix9aQRN": [
"Math"
],
"custom.ccf_joLD4t0eCqLhzqKLtKQBbm8WLS0DkQMrKpbGVrBAdGA": [
"MAX2"
],
"urls": [],
"organization_id": "orga_7lUFr4azrjwtX3Ls2aZM14Yt8n369T25XNNlk6J9Y6C",
"updated_by": "user_8ym1NFSM77aDdlFCOMjdhkPgUaX4hqfckmdkx22cWPa",
"name": "XXX",
"id": "cont_9vfqGY0zUNqh0fZIcfb9QRMrewaqDlPWX8RDMzHL1XZ",
"custom.ccf_B0nzghIi86909vNLANoDEqSBY8cf3AMQcHWQq8EVBim": [
"XXX"
],
"lead_id": "lead_pfhaTocTsau7upz1fHI4fC7EmyIURGrHH3U9FlLPmSo",
"custom.ccf_HhFzm0bLKAhy9OXFzCD8ojjFcJbUqFF3VhNmIxQg91N": [
"Grade 10"
]
}
]
},
{
"contacts": [
{
"date_updated": "2020-12-20T14:00:47.071000+00:00",
"date_created": "2020-11-26T01:49:23.171000+00:00",
"integration_links": [
{
"name": "Bio",
"url": "http://bio.brilliantgrades.com/XXX"
},
{
"name": "Video",
"url": "http://video.brilliantgrades.com/XXX"
},
{
"name": "Send Document via PandaDoc",
"url": "XXX"
}
],
"phones": [
{
"country": "US",
"phone": "+XXX",
"phone_formatted": "+1 XXX",
"type": "mobile"
}
],
"custom.ccf_F7atO93CXpppO74qw6bZRot4J6Y4KOHXK7zVwOzkI7U": "2020-12-20",
"title": "",
"display_name": "XXX",
"created_by": "user_8ym1NFSM77aDdlFCOMjdhkPgUaX4hqfckmdkx22cWPa",
"custom.ccf_JQfEM4g49NVpBMOpetyBenCRXZJMTW9P5s3fANgOYlE": [
"/Sun...14"
],
"custom.ccf_IXfh1a89OXSkbcjAIbMeG4MXcSsoTBWJHu1HskI4Odl": "2020-11-29",
"emails": [
{
"type": "office",
"email": "XXX"
}
],
"custom.ccf_dmJMdFxvfjz3EomR7MZPB9ogp5uOElqEAc8rix9aQRN": [
"ACT's"
],
"custom.ccf_joLD4t0eCqLhzqKLtKQBbm8WLS0DkQMrKpbGVrBAdGA": [
"MAX1"
],
"urls": [],
"organization_id": "orga_7lUFr4azrjwtX3Ls2aZM14Yt8n369T25XNNlk6J9Y6C",
"updated_by": "user_8ym1NFSM77aDdlFCOMjdhkPgUaX4hqfckmdkx22cWPa",
"name": "XXX",
"id": "cont_1dFTP6VlPY5Ym3s3fLlFDdlO368q6EhrSkUztHESanY",
"custom.ccf_B0nzghIi86909vNLANoDEqSBY8cf3AMQcHWQq8EVBim": [
"XXX"
],
"lead_id": "lead_hRaS99I1NCTg2UAevXQ4JxXtByBYxokMk9KEnVG8ijL",
"custom.ccf_HhFzm0bLKAhy9OXFzCD8ojjFcJbUqFF3VhNmIxQg91N": [
"Grade 9"
]
}
]
} ]
On a high level, I am looking to collect some of these properties which are located on different JSON paths and put them into 3 different tables in Backendless.
For now, I am trying to create a list of contacts with fewer properties.
I then want to add the contacts with the selected properties into a table.
As you can see, my data contains objects of arrays…of objects of arrays. I am trying to figure out how to specify JSON fields I need in an array using Codeless, a bit like using JSONPath.
Here’s what I have so far:
You can disregard the fact that I have return:enrolledStudents as I have been playing with that while debugging. When this is set to enrolledStudents1, it gives an empty array.
I am missing something and I am frustrated with myself. Is there a rule of thumb I can follow? eg. I know that when I want to get a list that is nested under a root object, I must use:
However, when there is a list of objects which contain arrays, how do I predictably capture the properties of those arrays that are 2 levels down?