โ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-10-2026 09:51 PM
Hi @AMacourek, ratherthan going with ruby or js, i can suggest you one native to workato solution, which will help you out, you can select JSON Request Body in the HTTP step rather than Raw JSON Request Body.
When you choose JSON Request Body as the Request Content Type, you can define the schema based on your request payload. This allows you to easily map data pills from previous steps without writing formulas manually or scripting.
For your reference, I am attaching an image. With this approach, there is no need for any additional steps.
โ02-11-2026 05:14 AM
I think that you did not understand my question. I have a Recipe Function that returns a defined schema.
After calling this function, I want to use the list and the data from another output to build a payload. I figured out that I needed to define the schema of a list to be able to use the list from the output.
Now, here is what I am trying to do.
โ02-11-2026 05:41 AM
one question is, how do you want to make a request to API, either you want to pass whole json body with array of items at once or one item at a time?
please let me know, then I can able to suggest the specific solution.
โ02-11-2026 06:09 AM
The API call would be the entire payload with the array of items.