Displaying Cascading Databases

Displaying Cascading Databases

  
My first post, so hopefully not too dumb a question :)

I am trying to show on a page the results of a cascading database, but without much joy at the moment.
Here is a simple example of what I am looking for.

Entity Continent
Id
Name

Entity Country
Id
Name
ContinentId

Entity Region
Id
Name
CountryId

Entity Town
Id
Name
RegionId

On page 1, I select the continent and pass as a parameter to page 2.
On page 2, I would like to see the following for that continent:

Country1   Region1  Town1
                                     Town2
                                     Town3
                    Region2  Town1
                                      Town2
Country2  Region1  Town1
                                    Town 2
etc.

I have tried numerous things including:
Entity Index
Id
CountryId
RegionId
TownId

and displaying within the Table Records widget.

Have been successful, in showing Country & Region, and Region & Town, but not all three together on the same table.

Any suggestions gratefully received.
Thank you, Mark
Hi Mark, and welcome to the OutSystems community forums :)

There are never any dumb questions, don't you worry.

If I understand your question correctly, it might just be the case that you need to have a query in the screen's preparation where you join the Continent with the Country and with the Region and Town, and then drag the three entities (Country, Region and Town) to the table record. That should display:

Country1 Region1 Town1
Country1 Region1 Town2
Country1 Region1 Town3
Country1 Region2 Town1
Country1 Region2 Town2
Country2 Region1 Town1
Country2 Region1 Town2
Country2 Region1 Town3
and etc.

Is this what you're trying to do?

Let us know how it goes!

Regards,

Paulo Tavares
Hi Paulo,
Many thanks for your reply.

Yes, that is exactly what I am trying to do!
In the screen preparation I have:

GetCountryByContinentId
GetRegion
GetTown

I can view the different Countries for the selected Continent, Regions for each Country, and Towns for each Region.
Dragging all three entities into the Table Records widget gives a challenge over the Source Record List to use.

Hence in the screen preparation are you suggesting to populate a seperate entity with the required results?

Regards,
Mark
Hi Mark,

What I'm suggesting is, instead of those 3 actions (or are they queries?), to have a single query.

1 - Drag the query node to the action flow;
2 - Double-click on it to open;
3 - Drag the 3 entities to the Query window;
4 - In the Parameters folder right-click it and create a new parameter of type ContinentId;
5 - Add a new condition, stating "Country.ContinentId = <InputParameterName> "
6 - In the screen create a Table Records
7 - Set the Source List as the Query's result list
8 - Drag the 3 entities (or the attributes you want) to the Table Records

I know, this may sound a bit overly vague, but if you try it I hope it makes sense when you're doing it, and that you can get it to work.

Let us know how it goes!

Regards,

Paulo Tavares
Hi Paulo,

Your answer was very clear and it works a dream!
At times when it doesn't work on the first or second attempt, we stray and look for the complicated way of doing things!
But this was easy and logical!

Thank you for being generous with your time and knowledge.

Kind regards,
Mark
Hi Mark,

I'm very glad you got it to work.

Let us know how your future developments go :)

Regards,

Paulo Tavares