{"id":39798,"date":"2023-05-12T08:51:40","date_gmt":"2023-05-12T08:51:40","guid":{"rendered":"https:\/\/crocoblock.com\/knowledge-base\/?post_type=article&#038;p=39798"},"modified":"2023-07-28T13:50:43","modified_gmt":"2023-07-28T13:50:43","slug":"how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon","status":"publish","type":"article","link":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/","title":{"rendered":"How to Display Array Elements from REST API Endpoint Using Sub Query Addon"},"content":{"rendered":"\n<p>The <strong>Sub Query<\/strong> addon allows retrieving array elements from a parent object property. Use it to fetch array elements in objects passed in a REST API endpoint and display them conveniently as a nested listing.&nbsp;<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/array_elements_of_parent_object_in_rest_api_query_2x.png\" alt=\"array elements of parent object in rest api query\">\n\n\n\n<h2 class=\"wp-block-heading\" id=\"connect-to-a-rest-api-endpoint\">Connect to a REST API Endpoint<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p>If you haven\u2019t connected to a REST API yet, navigate to <strong><em>WordPress Dashboard &gt; JetEngine &gt; JetEngine &gt; REST API Endpoints <\/em><\/strong>and connect your endpoint.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/connecting_to_an_endpoint_in_jet_engine_rest_api_2x.png\" alt=\"connecting to an endpoint in jetengine rest api\">\n\n\n\n<p>Click the \u201c<strong>Send Request<\/strong>\u201d<strong> <\/strong>button to ensure the request is successfully sent and the data is retrieved in the correct format. Don\u2019t forget to save this endpoint.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"set-up-a-custom-query-for-the-rest-api-endpoint\">Set Up a Custom Query for the REST API Endpoint<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\"><div class=\"note-banner d-flex border-bold border-jetsmartfilters rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M1 21H23L12 2L1 21ZM13 18H11V16H13V18ZM13 14H11V10H13V14Z\" fill=\"#FA5450\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Warning<\/div><p class=\"m-0\">This step is optional. If you don\u2019t need to query the endpoint, you can move on to the next part of the article. However, creating a query will help you see the data structure of the endpoint. <\/p><\/div><\/div>\n\n\n\n<p>To create a custom query, go to <strong><em>WordPress Dashboard &gt; JetEngine &gt; Query Builder &gt; Add New <\/em><\/strong>to create a custom query for the connected endpoint. Later, we will use this query to build the main listing for the REST API data.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/creating_custom_query_for_rest_api_endpoint_2x.png\" alt=\"creating custom query for rest api endpoint\">\n\n\n\n<p>In the settings of the custom query, select \u201cREST API Query\u201d as the <strong>Query Type<\/strong>. Then specify the endpoint in the <strong>From Endpoint <\/strong>dropdown from the REST API Query section. If necessary, add more query clauses to narrow down the results.&nbsp;<\/p>\n\n\n\n<p>Save the query and enable the <strong>Preview results <\/strong>toggle to preview the data retrieved by the query.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/preview_results_in_rest_api_query_2x.png\" alt=\"preview results in rest api query\">\n\n\n\n<p>In our example, we receive a list of students and specific data associated with them. In each object (student), there is a \u201clanguages\u201d array property containing an object with three properties \u2014 \u201cfirst-language\u201d, \u201csecond-language\u201d, and \u201cthird-language\u201d.&nbsp;<\/p>\n\n\n\n<p>There is also an \u201cextra-activities\u201d array containing just string values instead of objects.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/array_of_string_values_in_rest_api_query_2x.png\" alt=\"array of string values in rest api query\">\n\n\n\n<p>The elements of both arrays can be displayed as a nested listing with the help of the <strong>Sub Query<\/strong><em> <\/em>addon.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"download-and-install-the-sub-query-addon\">Download and Install the Sub Query Addon<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p>All the free addons for JetPlugins are listed on the <a href=\"https:\/\/crocoblock.com\/freemium\/tools\/\" target=\"_blank\" rel=\"noreferrer noopener\">DevTools<\/a> page. Navigate to that page, filter the addons by <em>JetEngine<\/em><strong>, <\/strong>and search for the <strong>Sub Query<\/strong><em> <\/em>addon. Click the<strong> <\/strong>\u201c<strong>Download<\/strong>\u201d<strong> <\/strong>button.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/downloading_the_sub_query_addon_2x.png\" alt=\"downloading the sub query addon\">\n\n\n\n<p>Afterward, return to the <strong><em>WordPress Dashboard<\/em><\/strong> &gt; <strong><em>Plugins <\/em><\/strong>tab, and press the \u201c<strong>Add New<\/strong>\u201d button to <a href=\"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-install-jet-plugins-via-wordpress-dashboard\/\" target=\"_blank\" rel=\"noreferrer noopener\">add the add-on<\/a>. Then, activate the plugin.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"set-up-a-sub-query-to-retrieve-the-array-of-objects\">Set Up a Sub Query to Retrieve the Array of Objects<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p>Now, we will use the <strong>Sub Query<\/strong> to retrieve elements from the array of objects.<\/p>\n\n\n\n<p>Create a new custom query in <strong><em>WordPress Dashboard &gt; JetEngine &gt; Query Builder &gt; Add New<\/em><\/strong>. Give a name to the query and choose the new \u201cSub Query\u201d <strong>Query Type<\/strong> from the corresponding drop-down.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/configuring_sub_query_in_jet_engine_2x.png\" alt=\"configuring the sub query in jetengine\">\n\n\n\n<p>Move to the body of the query, the <strong>Sub Query <\/strong>section.&nbsp;<\/p>\n\n\n\n<p>The query is intended to work with nested listings. That means the <strong>Listing Template<\/strong> that will be later built based on this query will be placed inside the main <strong>Listing Template<\/strong>. The Sub Query retrieves data from the parent object property, and in our use case, the parent object is the listing for REST API data.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/configuring_parent_object_property_in_sub_query_2x.png\" alt=\"configuring parent object property in sub query\">\n\n\n\n<p>The first required field is the <strong>Parent Object Property<\/strong> field. It expects the name of the parent property from where the data should be retrieved. In this query, we will retrieve array elements from the \u201clanguages\u201d property of a REST API object. Therefore, we specify \u201clanguages\u201d as the parent object to get data. <\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/preview_results_in_rest_api_query_2x.png\" alt=\"preview results in rest api query\">\n\n\n\n<p>Now, set up the <strong>Item Schema<\/strong> for the single item of the Sub Query object. In the schema settings, we indicate which fields each item of the Sub Query should consist of. It is needed to fill in this data to get access to these elements in the widgets\/blocks settings. Therefore, add only those properties that will be displayed in the nested listing, as it is not required to use all available properties in the array.<\/p>\n\n\n\n<p>The <strong>Property Name<\/strong> sets the label of the query item property. It will define how the initial object property is labeled in the query results. The <strong>Initial Object Property<\/strong> specifies the actual name of the property from the array. In our case, it is \u201cfirst-language\u201d.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/configuring_item_schema_in_sub_query_2x.png\" alt=\"configuring item schema in sub query settings\">\n\n\n\n<p>Add as many properties as needed to build the query item schema. Once done, save the changes.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"set-up-a-sub-query-to-retrieve-the-array-of-string-values\">Set Up a Sub Query to Retrieve the Array of String Values<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p>We will build another Sub Query to retrieve elements from the \u201cextra-activities\u201d array. This array consists of string values instead of objects.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/array_of_string_values_in_rest_api_query_2x.png\" alt=\"array of string values in rest api query\">\n\n\n\n<p>Create a new custom query of the \u201cSub Query\u201d type and proceed to the query settings.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/sub_query_for_array_of_string_values_2x.png\" alt=\"sub query for array of string values\">\n\n\n\n<p>As the <strong>Parent Object Property<\/strong>, we specify the \u201cextra-activities\u201d property.&nbsp;<\/p>\n\n\n\n<p>Move on to the <strong>Item Schema<\/strong>.&nbsp;<\/p>\n\n\n\n<p>If the array contains string or numeric values, it is needed to set one single property to store the value. The list of elements will be populated automatically. Therefore, add only one property to the schema and give it a name. Leave the <strong>Initial Object Property<\/strong> field empty.&nbsp;<\/p>\n\n\n\n<p>Save the query by pressing the corresponding button.<\/p>\n\n\n<div class=\"note-banner d-flex border-bold border-jetsmartfilters rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M1 21H23L12 2L1 21ZM13 18H11V16H13V18ZM13 14H11V10H13V14Z\" fill=\"#FA5450\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Warning<\/div><p class=\"m-0\">The elements inside the \u2018languages\u2019 array of objects can also be displayed with the help of the <strong>Get child element from object\/array<\/strong> callback of the <strong>Dynamic Field<\/strong> widget\/block. Therefore, instead of creating a <strong>Sub Query<\/strong>, it is possible to display each separate element of the array by placing the <strong>Dynamic Field<\/strong> field widget\/block in the main REST API listing template and applying the callback to get array elements. However, to display the \u2018extra-activities\u2019 kind of array, it is highly recommended to use a <strong>Sub Query<\/strong>. <\/p><\/div><\/div>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-nested-listings-based-on-the-sub-queries\">Create Nested Listings Based on the Sub Queries<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p>The next task is to build a nested listing that will output the elements inside our arrays. In the picture below, the \u201cLanguages\u201d and \u201cExtra Activity\u201d items represent nested listings based on sub queries.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/listing_for_rest_api_objects_2x.png\" alt=\"listing for rest api objects\">\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-the-listing-template-in-elementor\">Create the listing template in Elementor<\/h3>\n\n\n\n<p>To create a new listing, navigate to <strong><em>WordPress Dashboard &gt; JetEngine &gt; Listings<\/em><\/strong>. Click the \u201c<strong>Add New<\/strong>\u201d<strong> <\/strong>button to call a <strong>Setup Listing Item <\/strong>popup.&nbsp;<\/p>\n\n\n\n<p>Select \u201cQuery Builder\u201d as the <strong>Listing Source <\/strong>and find the previously created Sub Query in the dropdown of custom queries. Give a name to the listing and hit the \u201c<strong>Create Listing Item<\/strong>\u201d<strong> <\/strong>button.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/creating_listing_for_sub_query_in_elementor_2x.png\" alt=\"creating listing for sub query in elementor\">\n\n\n\n<p>Search for the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/articles\/jetengine-dynamic-field-widget-overview-how-to-use-filter-field-output\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Dynamic Field<\/strong><\/a><strong> <\/strong>widget and place it on the template. As a <strong>Source<\/strong> of the widget, leave the \u201cPost\/Term\/User\/Object Data\u201d option. Then, open the <strong>Object Field <\/strong>drop-down and search for the name of your Sub Query. Under the name of the query, there is a list of elements retrieved by the query. Using these elements, build your listing layout.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/building_listing_template_for_sub_query_source_2x.png\" alt=\"building listing template for sub query source\">\n\n\n\n<p>Don\u2019t worry if you don\u2019t see anything on the preview, as the elements will appear once you place the nested listing inside the primary listing.&nbsp;<\/p>\n\n\n\n<p>Once done with customizing, save the template by pressing the \u201c<strong>Publish\/Update<\/strong>\u201d button.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-the-listing-template-in-block-editor-gutenberg\">Create the listing template in Block Editor (Gutenberg)<\/h3>\n\n\n\n<p>To create a new listing, navigate to <strong><em>WordPress Dashboard &gt; JetEngine &gt; Listings<\/em><\/strong>. Click the \u201c<strong>Add New<\/strong>\u201d<strong> <\/strong>button to call a <strong>Setup Listing Item <\/strong>popup.&nbsp;<\/p>\n\n\n\n<p>Select \u201cQuery Builder\u201d as the <strong>Listing Source <\/strong>and find the previously created Sub Query in the drop-down of custom queries. Give a name to the listing, select \u201cBlocks (Gutenberg)\u201d for the <strong>Listing View<\/strong>, and hit the \u201c<strong>Create Listing Item<\/strong>\u201d<strong> <\/strong>button.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/creating_listing_for_sub_query_in_gutenberg_2x.png\" alt=\"creating listing for sub query in gutenberg\">\n\n\n\n<p>Search for the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/articles\/jetengine-dynamic-field-block-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Dynamic Field<\/strong><\/a><strong> <\/strong>block and place it on the template.&nbsp;<\/p>\n\n\n\n<p>As a <strong>Source<\/strong> of the widget, leave the \u201cPost\/Term\/User\/Object Data\u201d option. Then, open the <strong>Post Object <\/strong>drop-down and search for the name of your Sub Query. Under the name of the query, there is a list of elements retrieved by the query. Using these elements, build your listing layout.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/building_gutenberg_listing_template_for_sub_query_source_2x.png\" alt=\"building gutenberg listing template for sub query source\">\n\n\n\n<p>Don\u2019t worry if you don\u2019t see anything on the preview, as the elements will appear once you place the nested listing inside the primary listing.&nbsp;<\/p>\n\n\n\n<p>Once done with customizing, save the template.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-the-main-listing-to-display-the-endpoint-results\">Create the Main Listing to Display the Endpoint Results<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p><span id=\"docs-internal-guid-d0e935d5-7fff-072d-f86f-1c1c9c60d0bf\"><span style=\"font-size: 11pt; font-family: Arial; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; vertical-align: baseline;\">It is time to build the main listing to showcase the rest of the properties from the REST API endpoint.&nbsp;Add a new listing in <\/span><span style=\"font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 700; font-style: italic; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; vertical-align: baseline;\">WordPress Dashboard &gt; JetEngine &gt; Listings<\/span><span style=\"font-size: 11pt; font-family: Arial; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; vertical-align: baseline;\">.&nbsp;As a <\/span><span style=\"font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 700; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; vertical-align: baseline;\">Listing Source<\/span><span style=\"font-size: 11pt; font-family: Arial; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; vertical-align: baseline;\">, select one of the options: \u201cREST API Endpoint\u201d if you <\/span><\/span>didn\u2019t <a href=\"#set-up-a-custom-query-for-the-rest-api-endpoint\">create a REST API query<\/a><span id=\"docs-internal-guid-d0e935d5-7fff-072d-f86f-1c1c9c60d0bf\"><span style=\"font-size: 11pt; font-family: Arial; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; vertical-align: baseline;\">; \u201cQuery Builder\u201d if you created a REST API query.&nbsp;<\/span><\/span><\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/building_listing_template_for_rest_api_in_elementor_2x.png\" alt=\"building listing template for rest api in elementor\">\n\n\n\n<p>The same settings can be applied for the Gutenberg (Block Editor) view.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/building_listing_template_for_rest_api_in_gutenberg_2x.png\" alt=\"building listing template for rest api in gutenberg\">\n\n\n\n<p>If the source of the <strong>Listing Template <\/strong>is \u201cQuery Builder,\u201d find the name of the custom query in the <strong>Object Field <\/strong>drop-down and select any of the fields available. If the field did not appear in the dropdown, specify it manually in the <strong>Custom Object field \/ Meta field \/ Repeater key <\/strong>input field.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/building_listing_for_rest_api_query_in_elementor_2x.png\" alt=\"building listing for rest api query in elementor\">\n\n\n\n<p>The same settings are applicable for Block Editor (Gutenberg) view.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/building_listing_for_rest_api_query_in_gutenberg_2x.png\" alt=\"building listing for rest api query in gutenberg\">\n\n\n\n<p>Lastly, find the <strong>Listing Grid <\/strong>widget\/block and put it on the template. Use it to display the nested listings created previously.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/displaying_sub_query_listing_inside_the_main_listing_2x.png\" alt=\"displaying sub query listing inside the main listing\">\n\n\n\n<p>Note that it is not necessary to apply the Sub Query in the <strong>Custom Query <\/strong>tab of the <strong>Listing Grid <\/strong>widget\u2019s\/block\u2019s settings. The listing will still retrieve data from the custom query, which is the source of the <strong>Listing Template<\/strong>.<\/p>\n\n\n\n<p>Once you are finished, navigate to the page or template where the listing with REST API data should be visible and place the main listing on that page. The main listing will contain nested listings that output data from the parent object property.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/listing_for_rest_api_objects_2x.png\" alt=\"listing for rest api objects\">\n<\/div><\/div>\n\n\n\n<p>That\u2019s all about the Sub Query addon available for free as a part of the <em>JetEngine <\/em>plugin for your WordPress website.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Sub Query addon allows retrieving array elements from a parent object property. Use it to fetch array elements in objects passed in a REST API endpoint and display them conveniently as a nested listing.&nbsp; Connect to a REST API Endpoint If you haven\u2019t connected to a REST API yet, navigate to WordPress Dashboard &gt; [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"template":"","format":"standard","builder-category":[],"article-category":[405,407],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Display Array Elements from a REST API Endpoint in a Listing \u2014 JetEngine | Crocoblock<\/title>\n<meta name=\"description\" content=\"Learn how to display array elements retrieved from a REST API endpoint in a nested listing using the Sub Query addon of the JetEngine plugin for WordPress.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Display Array Elements from a REST API Endpoint in a Listing \u2014 JetEngine | Crocoblock\" \/>\n<meta property=\"og:description\" content=\"Learn how to display array elements retrieved from a REST API endpoint in a nested listing using the Sub Query addon of the JetEngine plugin for WordPress.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/\" \/>\n<meta property=\"og:site_name\" content=\"Help Center\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-28T13:50:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/array_elements_of_parent_object_in_rest_api_query_2x.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/\",\"name\":\"How to Display Array Elements from a REST API Endpoint in a Listing \u2014 JetEngine | Crocoblock\",\"isPartOf\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\"},\"datePublished\":\"2023-05-12T08:51:40+00:00\",\"dateModified\":\"2023-07-28T13:50:43+00:00\",\"description\":\"Learn how to display array elements retrieved from a REST API endpoint in a nested listing using the Sub Query addon of the JetEngine plugin for WordPress.\",\"breadcrumb\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/articles\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Display Array Elements from REST API Endpoint Using Sub Query Addon\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/\",\"name\":\"Help Center\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crocoblock.com\/knowledge-base\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#organization\",\"name\":\"Help Center\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg\",\"contentUrl\":\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg\",\"caption\":\"Help Center\"},\"image\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Display Array Elements from a REST API Endpoint in a Listing \u2014 JetEngine | Crocoblock","description":"Learn how to display array elements retrieved from a REST API endpoint in a nested listing using the Sub Query addon of the JetEngine plugin for WordPress.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/","og_locale":"en_US","og_type":"article","og_title":"How to Display Array Elements from a REST API Endpoint in a Listing \u2014 JetEngine | Crocoblock","og_description":"Learn how to display array elements retrieved from a REST API endpoint in a nested listing using the Sub Query addon of the JetEngine plugin for WordPress.","og_url":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/","og_site_name":"Help Center","article_modified_time":"2023-07-28T13:50:43+00:00","og_image":[{"url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/05\/array_elements_of_parent_object_in_rest_api_query_2x.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/","url":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/","name":"How to Display Array Elements from a REST API Endpoint in a Listing \u2014 JetEngine | Crocoblock","isPartOf":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#website"},"datePublished":"2023-05-12T08:51:40+00:00","dateModified":"2023-07-28T13:50:43+00:00","description":"Learn how to display array elements retrieved from a REST API endpoint in a nested listing using the Sub Query addon of the JetEngine plugin for WordPress.","breadcrumb":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-display-array-elements-from-a-rest-api-endpoint-using-the-sub-query-addon\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crocoblock.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"Articles","item":"https:\/\/crocoblock.com\/knowledge-base\/articles\/"},{"@type":"ListItem","position":3,"name":"How to Display Array Elements from REST API Endpoint Using Sub Query Addon"}]},{"@type":"WebSite","@id":"https:\/\/crocoblock.com\/knowledge-base\/#website","url":"https:\/\/crocoblock.com\/knowledge-base\/","name":"Help Center","description":"","publisher":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crocoblock.com\/knowledge-base\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/crocoblock.com\/knowledge-base\/#organization","name":"Help Center","url":"https:\/\/crocoblock.com\/knowledge-base\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/","url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg","contentUrl":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg","caption":"Help Center"},"image":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article\/39798"}],"collection":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/users\/9"}],"wp:attachment":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=39798"}],"wp:term":[{"taxonomy":"builder-category","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/builder-category?post=39798"},{"taxonomy":"article-category","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article-category?post=39798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}