I have screen to display all exhibitions with (Name, Start Date, End Date, participate company, Type) details in a table
If I make it one aggregate I got duplicated records
so I make 2 blocks and drag them to the table to solve this issue
Is there another way to get same result?
Thanks in advance
Something like this, a data action that returns the list of Exhibitions with the companies and types in the example below
Hello
Can one exhibition have multiple Types?
yes and multiple companies as well
I don't know if this is what you want, but if an Exhibition can have several types then it will bring several records for the same Exhibition if in fact it has several types. What you can do is fetch the type separately and show it as a comma-separated string. If you don't intend to display multiple types, then the foreign key is in the wrong table. the type must be in the displayed table
could u please explain more what do u mean by (fetch the type separately and show it as a comma-separated string )
Thank you so much
but in this way how to filter them by dropdown tag
I want to filter the table result by companies selected from the dropdown tag
you can filter on the aggregate within the data action or even on the functions you are calling. Today I can no longer provide you with another example.
you may also check my Forge component https://www.outsystems.com/forge/component-overview/15145/pattern-sql-patterns that shows how to turn an aggreagte result into a nested structure.
Stefan
Hi,
We can use SQL statement instead of aggregate here. In SQL using STUFF you can get multiple companies and events name separated by comma in a single record. For more reference https://stackoverflow.com/questions/21760969/multiple-rows-to-one-comma-separated-value-in-sql-server
regards