---
title: Transform Grouped List to a Flat List
slug: transform-grouped-list-to-a-flat-list
docTags: 
createdAt: 2021-12-22T07:28:32.000Z
---

Converts a single level nested list into a flat list. On conversion it only retains the values of the keys mentioned in the "group\_fields" and "list fields"&#x20;



### API Definition

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://orca.pathfix.com/functions/list/grouptolist",
  "name": "Transform Grouped List API",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "28UsDqyeH3QRdmtVamSQT",
        "code": "{\n\t\"output\": [{\n\t\t\t\"name\": \"Gates\",\n\t\t\t\"city\": \"Long Island City\",\n\t\t\t\"state\": \"New York\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Micheal\",\n\t\t\t\"city\": \"Lehigh Acres\",\n\t\t\t\"state\": \"Florida\"\n\t\t}\n\t]\n}",
        "language": "200"
      },
      {
        "id": "yIX64DyIuDPJgBRFSfAWb",
        "code": "{\n    \"message\": \"error\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "28UsDqyeH3QRdmtVamSQT"
  },
  "examples": {
    "languages": [
      {
        "id": "ENcJz9TStG38F0X-taA4x",
        "code": "{\r\n\t\"input\": [{\r\n\t\t\t\"name\": \"Gates\",\r\n\t\t\t\"address\": {\r\n\t\t\t\t\"street\": \"2037 Geraldine Lane\",\r\n\t\t\t\t\"city\": \"Long Island City\",\r\n\t\t\t\t\"state\": \"New York\"\r\n\t\t\t}\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"name\": \"Micheal\",\r\n\t\t\t\"address\": {\r\n\t\t\t\t\"street\": \"4212 Sunburst Drive\",\r\n\t\t\t\t\"city\": \"Lehigh Acres\",\r\n\t\t\t\t\"state\": \"Florida\"\r\n\t\t\t}\r\n\t\t}\r\n\t],\r\n\t\"input_list\": \"address\",\r\n\t\"group_fields\": \"name\",\r\n\t\"list_fields\": \"city,state\"\r\n}",
        "language": "json"
      }
    ],
    "selectedLanguageId": "ENcJz9TStG38F0X-taA4x"
  },
  "description": "\nCall the following API:",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::















