โ02-10-2026 05:23 AM - edited โ02-10-2026 05:27 AM
I have a need to read data from several sources and push that data into another API. The API input is the following schema:
{
"matchOnName": true,
"entities": [
{
"id": "00000000-0000-0000-0000-000000000000",
"entityFieldValues": [
{
"fieldId": "00000000-0000-0000-0000-000000000000",
"number": 0.0,
"string": "",
"dateValue": "",
"boolean": false
}
]
}
]
}What I need to do is for each record from the source build a record to add to the entities collection. Before adding to the collection, for each value, I need to add a record the entityFieldValues collection. This is trivial code in C#, JS, etc. I just want to know how to translate it into Workato.
I guess I could create a Ruby action to handle this, but I am unclear how to create hash objects based on a sample schema. The approach would be to first create base object. Then, for each source record, create array of values and call a function to add the values to the list for each value. Then, take this array and combine to create the entity object and the add to the entities collection. Would these all be Ruby actions?
Also, I have a Recipe Function that returns an object result. How can I pass this result to a Ruby action as an object?
โ02-11-2026 10:36 AM
This looks like a simple case of "how do I get from here to there?" but you only provided what "there" looks like. Can you provide samples of your different inputs so we can see how they need to be mapped to the final API format?
โ02-12-2026 11:29 AM - edited โ02-12-2026 11:36 AM
I have this working now. I just needed to figure out how Workato works with objects and nested lists. What really helped is a post that pointed out that a nested list can be populated by supplying the list of values in a formula.