Hi, is there a way to access the line number of a filtered list?

i want to apply a zebra pattern to the rows and dont want to loose it if the list gets sorted

Hi @AudaZ_Fernando_Sudicovich,

welcome to coda Community.

There is a way to achieve that, though it implies some easy formulas and a an assumption.

- You add a column (e.g.
`Rank`

) with the - wellâ€¦ - rank of your row inside the table with this formula:`Rank(thisRow,thisTable)`

- You sort the table by this
`Rank`

column - You set a conditional formatting to odd/even rows with the formula
`Rank.isOdd()`

The assumption is obviously that the zebra effect works as long as you keep the Rank sorted. I.e. changing sorting would potentially mess the alternation.

I hope it helps.

My bad: I didnâ€™t carefully read this (and in the title as wellâ€¦)

I donâ€™t delete my post (maybe itâ€™s useful for someone else), but definitely isnâ€™t helping you.

Hi @AudaZ_Fernando_Sudicovich,

Welcome!

I think the trick here is that the formula needs to include the same sort and filter as the overall table. You can check the second example here and the â€śSort Directionâ€ť column, which will keep the sort order and row number consistent.

This would be the type of formula youâ€™re looking for and you could substitute in canvas control values for things like filteringâ€¦

`thisTable.Filter(Category!="Numbers").Sort(false,thisTable.RowID).Find(thisRow)`

This is assuming I have the table filter for not equal to numbers and the table is sorted by a column called RowID.

Hereâ€™s the solution youâ€™re looking for, with all the details.

You cannot get the currently visible row that would respect sorting (or filtering if itâ€™s a master table and not a view), but you can sort with external controls and use their value to also calculate row position.