Results count for horizontal scrolling table not matching number of results

Hello,

I’m using the “Infinite Columns Horizontal Scroll Data Table with Fixed First Column” block to display the products and shipment data for my inventory management system.

I noticed that the result count at the top of the block is set via a custom state that is updated based on the number of results in the block’s repeating group.

How do I get this count to update when I filter the results? Upon filtering, the products table may only display 4 products, but the count is still 16 products.

For my shipments table, I am using the “Toggle Tabs Group” block in addition to the “Infinite Columns Horizontal Scroll Data Table with Fixed First Column” block.

I noticed when going from one tab to another, the results count is delayed and shows the last tab’s results. For example, if I go from the ‘All’ tab (4 results) to the ‘Pending’ tab (3 results), it will display 4 shipments in the results text. And then if I go from the ‘Pending’ tab (3 results) to the ‘Completed’ tab (1 result), it will display 3 shipments in the results text.

Is there a way to get the tab results and the text to line up? (Please see additional screenshots in the posts below.)

Hello @AndyC

To set the count replace the number 16 with “repeating group thing’s count”. If you have the rg’s search constraints dynamically set to the filters then the count should be updated.

If you are using the toggle tabs group it implies that you may be using more than one repeating group right?

Hello @cmarchan

In the Infinite Columns Horizontal Scroll Data Table with Fixed First Column block, the RG is within a reusable element. And the fixedtable RG in the reusable element is already doing a count and updating the “number of results” custom state of the reusable element.

If you are using the toggle tabs group it implies that you may be using more than one repeating group right?

I’m actually conditionally changing the search data source depending on which tab is selected. So it’s just one repeating group for the three tabs.

@AndyC

It would be easier to create the reusable to have the header be part of the reusable. This way the count will reflect what is filtered in the RG without the need to the event “do when true”.

image

@cmarchan

I guess I was trying to make it work within how the template was set up. But I understand that combining it is probably a simpler option. Probably like most reusable elements in the template could be simpler when broken out or combined with their on-page elements. I just wasn’t sure how steadfast we should try to be when working within the template’s structure as I assume there was a reason why the elements are structured that way.

I mentioned that the tabs were using the one RG, but I do have different RGs for client and admin views. So if I go down the path of combining the header into the reusable, I’ll need to do that for all the RGs.

Based on having multiple RGs for each section (Products & Shipments), would you still suggest to move the header into the reusable?

@AndyC Yes I suggest so.

OK, thanks @cmarchan

@cmarchan - I edited my last reply as I managed to get it working.

I changed the Do when condition to point to the same (left side) horizontal table repeating group rather than the other (right side) one.

By default, this results count workflow was setup to compare the left and right side repeating groups. I’m not sure if they’re will be any other flow on effects from making this change from the template’s default setting, but at least it results count is updating correctly now (for the tabbed view too).

@AndyC There is constant work retrofitting Canvas components to the preferences of an app developer. Width is one that is easily managed. :grinning:

@cmarchan - I edited my last reply as I got it working. But sure, I’ll keep in mind that I’ll need to be comfortable managing the width.

1 Like