i'm looking to find a trick to show table with nested table.
i create a function with a list input and return a list.
i'm using it in my nested table, giving a second table that fx will filter.
but OS doesn't show me elements to use in expression.
try to check in my oml.
Hello.
If you nest a table into another, the source of the nested table will not work as you are expecting.
The easy way of doing it it is with as block for the second table. You can nest the block into the first table and handle the data as you want.
yes i know, but i was looking for something generic to manage with list, table, ecc..
and an other thing.
in my fx, input is defined with the structure of table.
if i defined, for example, as text list, i can't map from the expression editor...why?
As Nuno Reis said OutSystems doesn’t directly support nested lists in Table Records via functions or inline SQL, as it promotes clear, maintainable design. The best practice is to use Web Blocks, which allow you to fetch and display related data separately. This approach improves reusability, keeps your UI modular, and aligns with OutSystems' visual development principles. It’s a positive design decision that encourages clean architecture and scalable applications across screens and modules.
this means i have to create a block for each nested table...lot and lot of blocks that i will use only one time...
instead extract dataset one time from sql and then filter, i have to exec a filtered query for each row.
not very good, i think.
Hi,
the approach of a webblock being passed in a parent id and fetching its own child records is commonly used, and it is of great simplicity, so perfect for beginners and good for maintainability of the code. I don't like it myself, since a table of 5 rows, means 6 trips to the server and from there to sql, instead of 1.
I personally prefer to have a data action at the parent level, returning the data nested, that works, you can pass the parentlist.current.childlist attribute into the child table widget. See attached oml for an example.
I had never tried with a filter function on client side like you are trying. You can use a function as the source of a table widget, but Service Studio does not offer any way of referencing the table data in the table rows. You can make it work if you wrap your table into a block, and pass the result of the function as input into the block. See attached oml fon an example.
But you have bigger fish to fry when you go this route : you can't use the List Actions inside your client function, so you will have to write your own filtering logic in Javascript. Also, since you are using 2 Aggregates, one for a list of parent records, one for a list of child records, you also have to deal with race conditions. So this is definitely not an approach I would advocate, just made it work for the sport of it.
Dorine
Another way I'm just thinking of : pass both full lists into the block, and execute a ListFilter in the OnParametersChanged. that's not a function, so you won't have to use Javascript
thank yo for support.
your solution is the same i done.
but i was looking for something to simplify this.
everything would be easier if could be possible use list filter fx in expression values.