Reporting protocol
Overview
Calcapp apps can send data in several ways:
- Emailed reports containing app data.
- Integration with third-party services like Google Sheets, Slack, Salesforce and databases through platforms like Zapier and Zoho Flow.
- Direct transmission to a custom server.
This guide covers the third option: sending data directly to a server you control. This is an advanced feature requiring you to operate a server and write software to accept the transmitted data (or have someone do it for you).
Data transmission uses either a server relay button or the RELAY function.
HTTP protocol
Data is sent over HTTP using the POST request method. Configure an HTTP endpoint on your server and enter its address in the Server address field. We strongly recommend using an HTTPS endpoint to ensure data security during transmission.
Data format
JSON structure
Data is transmitted as JSON with this structure:
{
"values": {
"Screen Name 1": {
"Field Name 1": "value",
"Field Name 2": "value"
},
"Screen Name 2": {
"Field Name 3": "value"
}
}
}
The top-level values object contains one
key for each form screen included in the data transmission. Each screen
key maps to an object containing the collected field values.
Data type mapping
Calcapp data types map to JSON as follows:
- Numbers → JSON numbers.
- Text → JSON strings.
- Logical values → JSON boolean values.
- Dates → JSON numbers using the same format as popular spreadsheets.
Key naming
Form screen labels and field labels are used as JSON keys when available. If a screen has no title or a field has no label, its internal name is used instead.
All keys within the same object are unique. If there’s a naming conflict, a serial number in parentheses is appended (e.g., “Result (2)”).
Example payload
Here’s an example payload mirroring the examples from the reporting guide:
{
"values": {
"Unit conversion": {
"Enter a length": 52,
"Result": 20.472440944882,
"Enter a volume": 6.3,
"Result (2)": 213.02834301
},
"Break-even analysis": {
"Fixed cost": 600000,
"Cost per unit": 125,
"Price per unit": 265,
"How many?": 4286
},
"°F to °C": {
"Enter temperature": 32,
"Result": 0
},
"°C to °F": {
"Enter temperature": 0,
"Result": 32
}
}
}