Delete row from Repeater, display remaining row count

repeater-widget

#1

I have a repeater with two rows in the data table. I have an icon in the repeater row that when clicked removes the row. I want to display a count of the remaining number of rows. I have the following interaction on a remove icon

CLICK or TAP
Delete Rows
repeaterName this row

Set Variable Value
rowCount to “[[Item.Repeater.itemCount]]”

This returns the total number of items in the repeater’s data table (2), rather than the number of remaining rows after one was deleted.

I’m obviously doing something wrong, or I lack understanding of what the itemCount is supposed to return. Is there another way to have my rowCount variable display the number of remaining rows after one or many are removed.


#2

Hi @nebuleah,

One way to achieve this is to use a Local Variable in your expression for the Set Variable Value action.
Your expression would look something like this:

[[LVAR1.ItemCount]]

…where “LVAR1” is a local variable for your repeater.

Here’s what that would look like in the Edit Text dialog:

You could also use a Set Text action instead of a Set Variable Value action if you only want to display the value on another widget in the prototype.

Hope this helps!


#3

Thank you for your help. This resolved my issue.