Log and sum an array of strings on schedule
Recipe ToolsDeveloper Tool
What it does
When a scheduled interval occurs, this automation logs an array of string elements to the job report. It then converts those strings to integers and calculates the sum.
Who it's for
Data and analytics teams who need to process numeric data on a recurring schedule.
How teams use this
Monitor daily totals from text logs
Run this automation each morning to convert a log file's string numbers into integers and sum them for a daily report. The job report shows both the raw data and the final total.
Calculate hourly metrics from API responses
Set the interval to every hour so this automation processes string values returned from an API, converts them to integers, and tracks the cumulative sum for your reporting cadence.
Filter and sum only values above a threshold
Add a condition in the Ruby code to check each integer against a minimum value before including it in the sum. Only numbers that meet your criteria are added to the final calculation.
How it works
- Run at the scheduled interval. This automation starts at the scheduled time you set, beginning the process to handle the array data.
- Log message with array elements. Write the array of string elements to the job report in Workato Custom Code so you can track what data entered the calculation.
- Convert strings to integers and sum. Execute Ruby code to transform each string element into an integer and calculate the total sum of all values.