--- title: Folding results - Example slug: '291' canonical_url: https://docs.coveo.com/en/291/ collection: javascript-search-framework source_format: adoc --- # Folding results - Example The following is a working example of result folding which relies on a [demo search endpoint](https://docs.coveo.com/en/331#configuring-a-demo-search-endpoint). More precisely, this endpoint contains a [source](https://docs.coveo.com/en/246/) whose [items](https://docs.coveo.com/en/210/) describe continents, countries, and cities. These items populate folding [fields](https://docs.coveo.com/en/200/) which represent their relationships, such as: * South America: ```json "foldingchild": "atlcontinentsouthamerica" "foldingcollection": "atlcontinentsouthamerica" "foldingparent": "atlcontinentsouthamerica" ``` * Brazil: ```json "foldingchild": "atlcountrybrazil" "foldingcollection": "atlcontinentsouthamerica" "foldingparent": "atlcontinentsouthamerica" ``` * Sao Paulo: ```json "foldingchild": "atlcitysaopaulo" "foldingcollection": "atlcontinentsouthamerica" "foldingparent": "atlcountrybrazil" ``` You write the following HTML page: ```html