How do we write a query for an array function within a struct to retrieve particular records from an array of objects? | Community
Skip to main content
Level 2
March 28, 2024
Solved

How do we write a query for an array function within a struct to retrieve particular records from an array of objects?

  • March 28, 2024
  • 1 reply
  • 855 views

How do we employ an array function within a struct to retrieve particular records from an array of objects?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kumar29917170hcyp

Hi @bellasnow5378 ,

 

You can achieve this by using an Inline Function, sample query is mentioned below:

SELECT inline(array(struct(1, 'a'), struct(2, 'b'))), 'AAA';

https://experienceleague.adobe.com/en/docs/experience-platform/query/sql/syntax#inline
For more details on higher-order functions follow the link below:

https://experienceleague.adobe.com/en/docs/experience-platform/query/sql/higher-order-functions

 

Regards,

Kumar Saurabh

1 reply

Kumar29917170hcypAdobe EmployeeAccepted solution
Adobe Employee
March 28, 2024

Hi @bellasnow5378 ,

 

You can achieve this by using an Inline Function, sample query is mentioned below:

SELECT inline(array(struct(1, 'a'), struct(2, 'b'))), 'AAA';

https://experienceleague.adobe.com/en/docs/experience-platform/query/sql/syntax#inline
For more details on higher-order functions follow the link below:

https://experienceleague.adobe.com/en/docs/experience-platform/query/sql/higher-order-functions

 

Regards,

Kumar Saurabh