So like others, I wanted the separator at the bottom of the gallery template to not appear on the last row.
This works:
With(
{
wList: Sort(
Filter(
'SPIFF - Requests',
galFilter.Selected.Value = "All" || Status.Value = galFilter.Selected.Value
),
Created,
SortOrder.Descending
)
},
ForAll(
Sequence(CountRows(wList)),
Patch(
Index(
wList,
Value
),
{RowNo: Value}
)
)
)
My challenge is that it broke the navigation to the data entry/edit form.
The OnSelect for the Gallery is this:
Set(varItem,ThisItem); ResetForm(frmRequest);ViewForm(frmRequest);Navigate(FormScreen)
The frmRequest.ltem = varItem. (This is what broke)
I don't really understand what is wrong but my suspicion is that ThisItem points to the record in wList which is not actually a real record from the original datasource.
And as I write this, I think the solution is to go and pick up the source record based on the ID value of the record in wList.
{Pause}
{Unpause}
And the solution is this:
First(Filter('SPIFF - Requests', ID=varItem.ID))
From the inside out, the Filter finds the record(s) where the ID field matches the ID field in the record defined by varItem. But since Filter returns a table, we need just one row. This took me far too long to figure out on my own but here we are. And since I know that ID=varItem.ID can only ever return one record in that table, just grabbing the first record with First will never fail.
Thanks again for attending my self tutorials. I leave a trail of my learning here because it provides me with a referenceable repository of my own troubleshooting and problem solving as well as providing solutions for others.