Expand my Community achievements bar.

Audiences with Array of Objects

Avatar

Level 3

Hi,

I’m working with a schema that contains an array of objects — for example:
accounts: [{ account_number, account_type, account_status }]

I’d like to create an audience that qualifies a user only if there is at least one object in the accounts array where:

  • account_type = "savings"

  • account_status = "active"

The key requirement is that both conditions must be true within the same object, not across multiple objects in the array.

 

Example scenario:
Given this user data:
accounts: [
{ account_number: "123", account_type: "savings", account_status: "inactive" },
{ account_number: "456", account_type: "checking", account_status: "active" }
]

 

The user should not qualify, as the savings account_type is in one object and account_status = active is in another object.

 

Any guidance on how to set this up in the audience builder would be appreciated!

 

Thanks!

6 Replies

Avatar

Community Advisor

Hi @trojan_horse , 

As far as I know, this specific use case — where multiple conditions must be met within the same object of an array — is not currently supported directly in Adobe Experience Platform’s Audience Builder.

 

Because of this limitation, it’s important to carefully consider how data is modeled and how it will be used for segmentation before designing the schema.

 

If you know there will only be a limited number of account objects (for example, a maximum of three), you can define the audience condition using positional array indexing like this:

 

(accounts[0].account_type == "savings" AND accounts[0].account_status == "active")
OR
(accounts[1].account_type == "savings" AND accounts[1].account_status == "active")
OR
(accounts[2].account_type == "savings" AND accounts[2].account_status == "active")

 

This approach isn’t ideal, but it can work if the number of possible array entries is small and fixed.

 

Hope this helps!

 

Kind regards,

Parvesh

 

Parvesh Parmar – Adobe Community Advisor
https://www.linkedin.com/in/parvesh-parmar/

Avatar

Level 3

Thanks Parvesh. 

 

Question, how exactly can we refer to an index of the array from audiences, using the audience builder?

Avatar

Level 6

Hi @trojan_horse ,

In the Segment Builder UI itself you cannot pick “accounts[1].account_type” (or any arbitrary zero-based index). The UI treats arrays as unordered collections and only gives you the built-in quantifier functions (exists/includes/count, etc.), so there’s no “pick element at position N” control in the drag-and-drop canvas.
If you really need position‐based access you have to flip into Code View (the PQL editor) and use the little “first-item” helper that PQL exposes:

accounts.head().account_type = "savings"

Reference: https://experienceleague.adobe.com/en/docs/experience-platform/segmentation/pql/array-functions

UI (drag-and-drop): no direct index access

Code View (PQL): use accounts.head().field for the first element; beyond that, you’d need to move into a post-ingest SQL/Query Service solution for arbitrary positions.

Note: This response is inspired from Generative AI.

 

Thanks,

Ankit

Avatar

Community Advisor

Hi @AnkitJasani29 , 

Yes, you are right, we cannot define it.

I think I saw somewhere that when we export array object data, we can define it in that format, and then the data can be exported.

But yes, it is not going to work in Audience Builder for query the data.

 

Kr,

Parvesh

Parvesh Parmar – Adobe Community Advisor
https://www.linkedin.com/in/parvesh-parmar/

Avatar

Community Advisor

Hi @trojan_horse ,

 

I have created an array object attribute in schema. 

 

Parvesh_Parmar_0-1748234938426.png

 

I tried to create an audience based on this attribute.

 

Parvesh_Parmar_1-1748235091828.png

 

Can you please try like this, it might solve?

 

Hope it will help.

 

Kr,

Parvesh

 

 

Parvesh Parmar – Adobe Community Advisor
https://www.linkedin.com/in/parvesh-parmar/

Avatar

Employee

Hi @trojan_horse ,

 

I would recommend reviewing the response to similar question posed here. This is possible.

 

 

  • When you drag an item from the left rail that is in an array, it makes a "variable" container.
  • This container looks different from other, simple containers in that it shows a "variable pill".
  • This variable represents a single item from the array. If you want a single item to match multiple criteria, you place all rules inside that same single variable container.