Lesson 8 of 8
Call SpreadsheetWeb Calculations from Workato
Build a Workato recipe that sends dynamic inputs to the SpreadsheetWeb calculation API, maps the JSON request, and reads a calculated output.
3 min readUse Workato to send dynamic inputs to a SpreadsheetWeb API application and pass its calculated outputs to later recipe steps. This example sends an origin ZIP code, destination ZIP code, and package weight to an Excel-based calculation that returns a shipping cost.
Before you begin
You need:
- A Workato account with permission to create projects and recipes.
- A SpreadsheetWeb API application with
originZIP,destinationZIP, andweightinputs and acostoutput. - The workspace ID and application ID shown in the application's API Toolkit.
- The authentication settings required by the application.
1. Create a Workato project
- Sign in to Workato and open Projects.
- Select Create.
- Enter a descriptive project name, such as Excel Calculation Integration.
2. Create a recipe
- Open the project, select Create, and then select New recipe.
- Enter a recipe name, such as SpreadsheetWeb API Integration Recipe.
- Choose Function Call as the trigger so the recipe can receive dynamic input values.
3. Define the input schema
Define the three values that the recipe will pass to SpreadsheetWeb. You can create the schema from this sample JSON:
{
"originZIP": "string",
"destinationZIP": "string",
"weight": "string"
}
Keep workspaceId and applicationId out of this schema when they are fixed for the recipe. You will enter them in the HTTP request.
4. Send the calculation request
- Add a recipe step and select Send request via HTTP.
- Set Method to POST.
- Set URL to
https://api.spreadsheetweb.com/calculations/calculatesinglesimple. - Configure the authentication required by your SpreadsheetWeb API application. Select No authentication only when the application intentionally allows anonymous access. For a protected production application, provide its bearer token in the
Authorizationheader. - Add the
Content-Type: application/jsonheader. - Enter the following request body. Replace the example identifiers and map the three blank input values to the corresponding Workato datapills from the Function Call trigger.
{
"request": {
"workspaceId": "your-workspace-id",
"applicationId": "your-application-id",
"inputs": {
"originZIP": "",
"destinationZIP": "",
"weight": ""
},
"outputs": ["cost"]
}
}
The workspace ID and application ID are identifiers, not passwords. Keep any authentication token in a Workato connection or another secret-backed configuration rather than placing it directly in the recipe body.
5. Map the calculated response
- Add a Log message to job report step after the HTTP request.
- In Message, open the datapills from the HTTP step and select the returned
costoutput. - If Workato has not generated fields for the JSON response, test the HTTP step once with sample inputs, inspect the response, and refresh its output schema. Then select
costfrom the response outputs.
Logging is useful while building the recipe. In a production workflow, map the same output datapill to the application or action that needs the calculated value.
6. Test the integration
- Run the recipe with sample
originZIP,destinationZIP, andweightvalues. - Confirm that the HTTP step succeeds and sends the expected input values.
- Open the Job report and verify that it shows the calculated
costvalue. - Test an invalid input and an authentication failure so the recipe handles API errors appropriately before you activate it.