07-15-2025 01:11 AM
Hello Team,
Has anyone worked with the data_table_lookup formula in Workato?
I'm trying to fetch multiple records from a data table based on a condition, but it seems to only return the first matching record, not all.
Here’s an example of my data table:
Student Name Class Course Joined
StudentName | Class | Course Joined |
Student1 | 7th | Python |
Student2 | 6th | Java |
Student3 | 7th | Java |
Student4 | 10th | JavaScript |
Student5 | 10th | HTML & CSS |
Student6 | 10th | Python |
Student7 | 8th | JavaScript |
(Assume this table is sorted by Created Time in ascending order.)
When I use the formula below to fetch student names who joined the Python course, I only get the first matching record:
data_table_lookup("<datatable folder path>", "StudentDetails", CourseJoined: "Python")["StudentName"]
This only returns Student1, but I was expecting it to return all matches (like Student6 as well).
I've checked the documentation, but I couldn't find anything helpful for this use case. Would love to know if anyone has come across a workaround or better way to handle this.
Thanks in advance!
07-15-2025 01:50 AM - edited 07-15-2025 01:54 AM
Hi @Bhagya_pola,
As per my understanding and experience:
The data_table_lookup formula in Workato is designed to return only the first matching record, not all matches. This is expected behavior and is by design — it does not support retrieving multiple matching records directly.
Same like lookup tables also, with lookup formula, we are able to retrieve only one value, but there we can make use of the "search entries" action to retrieve multiple values.
If your use case requires fetching all records that match a certain condition (e.g., all students who joined the "Python" course), then you’ll need to use an alternative approach like:
by using SQL Transformations by Workato:
This will return all matching records, not just the first one.
07-15-2025 02:06 AM
Hello @rajeshjanapati ,
Thank you for your input!
My intention behind using the formula was to reduce task consumption and minimize the number of steps in the recipe. Currently, I'm using the Search records action with filter criteria from the data table, and I was hoping to replace that with a formula-based approach.
Unfortunately, it doesn't seem to achieve the desired result in this case.
Thanks again for your response!
07-15-2025 02:42 AM - edited 07-15-2025 02:44 AM
Yes, to reduce the number of steps and tasks, instead of using Search Records, I would recommend using SQL Transformations by Workato application ( with in the query you can pass the conditions as you mentioned in search records action). With this approach, you can query data tables directly within the step. It consumes only one task, and the output can be stored as a file in FileStorage — all within a single task execution.
Regarding the data_table_lookup formula — by default, it's designed to return only the first matching record. I'm not exactly sure why it's built this way, but it might be intended for quick condition checks, similar to how ternary operations work in programming.
07-15-2025 03:49 AM
Yes, we can go with SQL transformations as well, but I don’t need that for my use case.
I’m using a scheduler (data table polling won’t work for my scenario), and within that, I’m using Search records as the initial step. So I was looking to set up a trigger condition using the data_table_lookup formula instead.