How to get count of items from a different screen
Application Type
Reactive

I have a screen which queries data and returns, lets say for example, two records (Screen 1). These records are links and upon clicking them we go to a new screen which than holds data records specific for that record (Screen 2).


My question is: how to add to Screen 1 a new column which displays the number of items in Screen 2 for each record from Screen 1?


Thank you.

question.pdf

Hi @Fran C ,

An alternative, and considering that you only need the count is to modify your aggregate in screen 1. Lets say your records for screen 1 come from entity 1, and the records for screen 2 from entity 2. 

On the screen 1 aggregate you can left join entity 2, and group the entity 1 attributes, performing a count over the id attribute of entity 2.

Cheers,

Bruno

Thank you!

A really easy, fast way that I can think of giving you that, is by creating a block and passing the id of the record/records that you are displaying. And inside of the webblock you are counting with a data action how many records there are. And then you put on an expression the return value from the data action.

By doing that you are doing what you want.

EDIT:

Bruno Freitas's solution is the best in this case.

Kind Regards,

Márcio

Hi @Fran C ,

An alternative, and considering that you only need the count is to modify your aggregate in screen 1. Lets say your records for screen 1 come from entity 1, and the records for screen 2 from entity 2. 

On the screen 1 aggregate you can left join entity 2, and group the entity 1 attributes, performing a count over the id attribute of entity 2.

Cheers,

Bruno

Thank you!

mvp_badge
MVP

People let's not repeat the same solution multiple times, if it is provided by someone no need to suggest the same hours later. There are enough other questions that deserve that yet not have a good solution proposed you could focus on.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.