---
title: Convert a JSON Object from one format to another
slug: convert-a-json-object-from-one-format-to-another
docTags: 
createdAt: 2022-11-25T14:44:26.000Z
---

Convert the JSON from one format to the other based on the substitutions from given input into the defined output

| Options                 | Possible Values,Default   | Description                                                                                    |
| ----------------------- | ------------------------- | ---------------------------------------------------------------------------------------------- |
| replace\_if\_not\_found | yes/no, Default is **no** | If a specific item is not found in a list it will be replaced by an empty string.<br />e.g. "" |

### API Definition

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://orca.pathfix.com/functions/json/replacefrominput",
  "name": "Convert JSON API",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "28UsDqyeH3QRdmtVamSQT",
        "code": "{\n    \"output\": {\n\t\t\"name\":\"Bruce Wayne\"\n\t\t\"eml\":\"bruce@dc.com\"\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\"first_name\":\"Bruce\",\r\n\t\t\"last_name\":\"Wayne\",\r\n\t\t\"email\":\"bruce@dc.com\"\r\n\t},\r\n\t\"output\":{\r\n\t\t\"name\":\"{{first_name}} {{last_name}}\"\r\n\t\t\"eml\":\"{{email}}\"\r\n\t},\r\n\t\"replace_if_not_found\":\"\" \r\n}",
        "language": "json"
      }
    ],
    "selectedLanguageId": "ENcJz9TStG38F0X-taA4x"
  },
  "description": "\nCall the following API:",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

















