I don't understand if it is possible to use the Read data action/fn to retrieve records from 2 tables with a one-to-many relation.
When I add a 2nd table and select Multiple matching records, foreign key in this table in the debugger I see 2 queries, one for the main table and one for the related one. And the 2nd query is not what I expect anyway because it filters records as
SELECT * FROM 2ndTable WHERE foreignKey IN (list of primary table ids).
What I would expect is a query that returns an array similar to:
I was able to achieve something like that only when I set the primary table to retrieve the First matching record.
Is there a way to retrieve a list of records from a main table (say receipts) and the related records (say products) from a 2nd table?
Thank you
maxx
When I add a 2nd table and select Multiple matching records, foreign key in this table in the debugger I see 2 queries, one for the main table and one for the related one. And the 2nd query is not what I expect anyway because it filters records as
SELECT * FROM 2ndTable WHERE foreignKey IN (list of primary table ids).
What I would expect is a query that returns an array similar to:
[0] =>
[mainTable] =>
[field1] => value1,
[field2] => value2,
....
[2ndTable] =>
[fieldA] => valueA,
[fieldB] => valueB
[1] =>
and so on
I was able to achieve something like that only when I set the primary table to retrieve the First matching record.
Is there a way to retrieve a list of records from a main table (say receipts) and the related records (say products) from a 2nd table?
Thank you
maxx