---
agentTools:
  projectIndex: https://openasapp.readme.io/llms.txt
---

# /fields/calculateResult

Use an app as calculation service and calculate a result given input parameters.

Here you can use your calculation app through the API. Put your input values in the body like in this example.

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"inputValues\": {\n    \"A2\": 12,\n    \"B2\": \"Simple Text\"\n  }\n}",
      "language": "json"
    }
  ]
}
[/block]

The keys are the input fields from your App.

See [Calculation App](https://openasapp.readme.io/reference/calculation-app) for a complete example.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Production",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.openasapp.net"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "token"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/api/apps/{appId}/fields/calculateResult": {
      "post": {
        "summary": "/fields/calculateResult",
        "description": "Use an app as calculation service and calculate a result given input parameters.",
        "operationId": "calculateresult",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "description": "Id of the calculation app",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inputValues": {
                    "type": "object",
                    "description": "Object with Key Value pairs. The Key is the Field and the Value is the field Value.",
                    "properties": {
                      "A2": {
                        "type": "string",
                        "description": "Example Key with a String value"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"outputValues\": {\n    \"A10\": {\n      \"value\": 31.834212415342837,\n      \"string\": \"31.83\"\n    },\n    \"NamedOutputField\": {\n      \"value\": \"Text\",\n      \"string\": \"Text\"\n    }\n  },\n  \"attachments\": {}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "outputValues": {
                      "type": "object",
                      "properties": {
                        "A10": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "number",
                              "example": 31.834212415342837,
                              "default": 0
                            },
                            "string": {
                              "type": "string",
                              "example": "31.83"
                            }
                          }
                        },
                        "NamedOutputField": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string",
                              "example": "Text"
                            },
                            "string": {
                              "type": "string",
                              "example": "Text"
                            }
                          }
                        }
                      }
                    },
                    "attachments": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "59c3f878a9ddb8001c119a7b:59cbbcdf3d747e0028fc43a3"
}
```