Having trouble getting an array of objects inside of an array of objects

Using Codeless, I need to get an array of objects inside of another array of objects.

Here’s the JSON:

[
{
“All_ACCO_Contacts_In_List”: “Somebody Else nobody@nowhere.com”,
“List_Owner”: “nobody@nowhere.com”,
“created”: 1598136947000,
“List_Name”: “1515 - Five Star Credit Union, Corporate Office”,
“___class”: “EmailLists”,
“ownerId”: null,
SelectedContactsInList”: [
{
“BusinessCity”: “Albuquerque”,
“Company”: “Acme, Incorporated”,
“FileAs”: “Abbot, Andy”,
“CreatedByUser”: “nobody@nowhere.com”,
“BusinessStreet”: “1710 Randolph Ct SE”,
“Rating”: null,
“Website”: “www.acme.com”,
“EmailAddress2”: “nobody@somewhere.com”,
“Image”: “{‘url’:‘622bcffe4a1713b865b17c4c1e8ba8bad8e39831d50744b692dcd8a622ae8b90.jpg’,‘size’:248401,‘width’:1190,‘height’:1478,‘filename’:‘095207186e097139329a7a47ea12ee88.jpg’}”,
“ownerId”: null,
“JobTitle”: “Explosives Expert”,
“MobilePhone”: “(452) 648-7895”,
“ContactAccessLevel”: null,
“BusinessCardImage”: null,
“BusinessState”: “NM”,
“___class”: “ACCOContacts”,
“Private”: false,
“objectId”: “85665416-6D80-4F7B-95D0-424FC5CEFDC6”,
“Notes”: “This is a fake contact for testing with all of the fields populated.”,
“ContactWebpageLink”: “www.acme.com/boom”,
“BusinessPostalCode”: “87106”,
“FirstName”: “Andy”,
“created”: 1594579649113,
“AssignedAddressCategories”: “”,
“ContactIsDestinationinLists”: “”,
“Recycled”: false,
“MiddleName”: “”,
“EmailAddress”: “andy.abbot@acme.com”,
“Contact_Name”: “Andy Abbot”,
“Suffix”: “”,
“Listing”: “Andy Abbot (Acme, Incorporated)”,
“BusinessPhone”: “(800) 800-ACME”,
“BusinessPhone2”: “(800) 801-ACME”,
“LastName”: “Abbot”,
“updated”: 1646451213000
},
{
“BusinessCity”: “Albany”,
“Company”: “Hyperpixels, Inc.”,
“FileAs”: “Kadron, Biscuit”,
“CreatedByUser”: “”,
“BusinessStreet”: “1234 Anywhere ST”,
“Rating”: 2,
“Website”: “www.hyperpixels.net”,
“EmailAddress2”: “”,
“Image”: “{‘url’:‘57e4f9203d01d27cc4db6e46ba87959321c9a333b8235a0a64d86498ffa9cf58.jpg’,‘size’:1893336,‘width’:3264,‘height’:1840,‘filename’:‘2016-12-30 14.22.44.jpg’}”,
“ownerId”: null,
“JobTitle”: “Security Director”,
“MobilePhone”: “”,
“ContactAccessLevel”: null,
“BusinessCardImage”: null,
“BusinessState”: “GA”,
“___class”: “ACCOContacts”,
“Private”: false,
“objectId”: “8E9F8C27-DB3A-4234-8B15-CA3D335FEA94”,
“Notes”: “”,
“ContactWebpageLink”: “”,
“BusinessPostalCode”: “31721”,
“FirstName”: “Biscuit”,
“created”: 1593990096171,
“AssignedAddressCategories”: “”,
“ContactIsDestinationinLists”: “”,
“Recycled”: false,
“MiddleName”: “”,
“EmailAddress”: “nobody@gmail.com”,
“Contact_Name”: “Biscuit Kadron”,
“Suffix”: “”,
“Listing”: “Biscuit Kadron (Hyperpixels, Inc.)”,
“BusinessPhone”: “(877)123-4567”,
“BusinessPhone2”: “”,
“LastName”: “Kadron”,
“updated”: 1664550141573
},
{
“BusinessCity”: “Albany”,
“Company”: “Hyperpixels, Inc.”,
“FileAs”: “Kadron, Michael”,
“CreatedByUser”: “somebody@somewhere.com”,
“BusinessStreet”: “1234 Anywhere ST”,
“Rating”: 5,
“Website”: “www.hyperpixels.net”,
“EmailAddress2”: “”,
“Image”: “{‘url’:‘48cd399917dfc219d6f9b62773dfe13187f1a409d89ff978381175a75f241e01.jpg’,‘size’:595072,‘width’:814,‘height’:1147,‘filename’:‘Michael Kadron.jpg’}”,
“ownerId”: null,
“JobTitle”: “CEO”,
“MobilePhone”: “”,
“ContactAccessLevel”: null,
“BusinessCardImage”: null,
“BusinessState”: “GA”,
“___class”: “ACCOContacts”,
“Private”: false,
“objectId”: “D27E3A2F-5255-4B38-BF8F-076F5CFA3141”,
“Notes”: “”,
“ContactWebpageLink”: “”,
“BusinessPostalCode”: “31721”,
“FirstName”: “Michael”,
“created”: 1593989250184,
“AssignedAddressCategories”: “”,
“ContactIsDestinationinLists”: “”,
“Recycled”: false,
“MiddleName”: “”,
“EmailAddress”: “somebody@somewhere.com”,
“Contact_Name”: “Michael Kadron”,
“Suffix”: “(Mike)”,
“Listing”: “Michael Kadron (Hyperpixels, Inc.)”,
“BusinessPhone”: “(877) 123-4567 x1”,
“BusinessPhone2”: “”,
“LastName”: “Kadron”,
“updated”: 1646423291000
}
],
“List_GUID”: “d1d90a67-aefe-4c53-bfcd-fd7b5983c2b6”,
“updated”: 1598479699000,
“objectId”: “2E8F74CC-1E44-4002-B529-6BA04611CF66”
}
]

I need to only retrieve the “SelectedContactsInList” array of objects, so I can put them alone into a data repeater.

What is the best (most efficient) way of doing this?

The best (or only) way is to get the list from inside of the list… :wink:

Have you tried creating any logic for it? If so, please share what you have.

Oh my, yes.

I’ve tried many, many iterations.

Do you have any sample logic for doing this using the correct blocks?

Or can you point me to a video that accomplishes this?

I know I’m probably doing something stupid…

I need to make “SelectedContactsInList” (which is the list from the Relationship column) a separate list.

The codeless logic in your screenshot does various things with the database (loading relations, loading objects).

Where does the JSON you shared in the initial post come from?

It comes from that print statement.

The Print statement simply prints what it gets. I am trying to understand where you get the data. Can you describe the name of the table that has the data, what other relation you need, etc.

The data comes from my EmailLists table.

I need to make “SelectedContactsInList” (which is the list from the Relationship column above from the “Load Table Objects” block) into a separate list so I can put them alone into a data repeater.

The “Load Object Relations” block simply loads the currently logged in users’ default contact list (objectId) from the database.

…and the “Load Table Objects” block loads the data from the “EmailLists” table using the objectId retrieved from above, and returns the one EmailList, along with its relationship column.

This would do it:

1 Like

I was way overthinking it! :slight_smile:

It’s working perfectly now!

Thanks Mark!!!

1 Like