How can i get the “”row.index”” variable which not shown of a repeater?


#1

When I set item.column0 of all rows to [[item.index]], values for columns that are not displayed will be set to “NaN”

how to get index of all rows.rp (51.9 KB)


#2

I think the repeater pagination basically acts like a filter. When a repeater is filtered, undisplayed rows basically don’t exist, so they don’t have an index. It looks like when you try to assign a non-existent index number it probably assigns a null value. When a variable or text value is numeric, a null value is usually shown as “NaN” meaning, Not a Number.

If you remove the pagination from the repeater, your Update Rows action works fine. If you apply a filter to the repeater then click your button, then remove the filter, the same result occurs–filtered rows get assigned “NaN”.

The only way I can think to get around this for a paginated or filtered repeater would be to create a separate column and assign it index numbers. Don’t change the values in this new column. When you want to assign Column0 to the index number–relative to the entire repeater dataset and not just within the current page or filter–you can simply use the value in this new “index column”.

Here is an updated file where I tested a few things, and show my suggested solution on Page 4.
how to get index of all rows.rp (111.0 KB)

  • Page 1 is your original
  • Page 2 is identical to Page 1 except the repeater style was changed to turn off pagination. It shows that your code works fine in a regular repeater.
    • I also created a Click or Tap event for the repeater widget so it sets its value to “X” This was just a test for me to ensure that your Update Rows interaction code actually changed the value back to the index.
  • Page 3 was an attempt to get all rows updated by marking all rows, updating rows, then unmarking all rows. It didn’t work–behaves same as your original.
    • I then added ability to right-click on the repeater widget to report its index. So, if you right-click row 1, it updates a text widget to “1”; right-click on row 2, it updates text to “2” and so forth. But, if you go to the next page and click on the first row shown, “6”, it updates the index text to “1”. I believe this confirms my assumption that pages are really a type of filter.
  • Page 4 changes a few things, and I believe is a good solution for your issue here.
    • I added a column to the repeater, named “MyIndex” and copied all the number values from Column0.
    • I changed the right-click Set Text action to refer to [[Item.MyIndex]] instead of the raw [[Item.index]] variable.
    • I changed the “Update all item…” button’s Update Rows action similarly, to set the value of Column0 to the value of MyIndex. This works for all rows with pagination.