02-20-2026 01:26 PM
Documentation referenced:
- Ruby Snippets by Workato: https://docs.workato.com/en/connectors/ruby-snippets-by-workato.html
- Available Ruby methods: https://docs.workato.com/en/developing-connectors/sdk/sdk-reference/ruby_methods.html#lookup
I'm trying to understand how I might be able to use lookup() within the ruby snippet. The documentation implies that you should be able to, but whenever I try, I receive this error:
Lookup Tables are not initialized. Init data by calling LookupTable.from_file or LookupTable.load_data code.rb
The line I have in the snippet is quite simple:
#...
plans_by_supplier.each do |supplier, lines|
vendor = lookup("Supplier Vendor Table", site: supplier)["vendor"]
# ... other stuff here
plans << {
vendor: vendor
}
end
#...
At the end of the day what I'm trying to do is be able to find the value associated to a given key and return that field for each key in an array.
I know it can be done in a regular formula, but that would require looping through multiple layers of arrays to get to the fields I want, resulting in 100s of tasks.
I'm happy to hear other suggestions to solve my issue, or any context for if this should work, if it would work with data_tables instead.. etc?
02-20-2026 02:00 PM - edited 02-20-2026 02:01 PM
I think there are three different Ruby gems used in Workato:
My recommendation is to get your entire lookup table in a previous action and pass it into Ruby snippet as input. This won't work if the LUT is over 10k rows.
If this is simply mapping problem, you may not need to use the Ruby snippet at all. It may be possible to get the keys you need without looping, but I would need to see the payload structure to know for sure.
02-23-2026 10:48 AM
HI @gary1 ,
How you know all this information (Gems), I'm a bit curious :), are these mentioned in the doc?
02-23-2026 10:56 AM
I don't know with 100% certainty, but I feel it's fair to assume...
This page mentions the SDK gem, which no longer has any whitelist:
The page below is for connector documentation and mentions a whitelist for the Ruby connector, but the link to the SDK implies the whitelist was removed. This is inaccurate because the Ruby connector does still have a whitelist and behaves differently from the SDK.
https://docs.workato.com/en/connectors/ruby-snippets-by-workato.html#runtime-version
And lastly, formula mode obviously has a whitelist, which is loosely mentioned here:
https://docs.workato.com/en/formulas/formula-mode.html
Because all three of them behave differently, I can only assume they are driven by three unique gems!
02-23-2026 11:05 AM
Oh Okay, got it.
Appreciate your effort for sharing the detailed info....will look into these 😄.