
Announcements
With(
{
prodCountRow: Filter(
'Sales Data',
StartsWith(
'Product Name',
txtSearchProduct.Value
)
)
},
ForAll(
Sequence(CountRows(prodCountRow)),
Patch(
Last(
FirstN(
prodCountRow,
ThisRecord.Value
)
),
{ProdRowNumber: Value}
)
)
)
Set(varCurrentNewsID, ThisItem.ID);
Navigate(DetailScreen, ScreenTransition.Fade)
LookUp(colFilteredNews, ID = varCurrentNewsID)
Step 4: Add "Next" and "Previous" Buttons: (Here colFilteredNews is a sample collection storing news data)Set(
varCurrentIndex,
LookUp(colFilteredNews, ID = varCurrentNewsID, Index)
);
If(
varCurrentIndex > 1,
Set(varCurrentNewsID, LookUp(colFilteredNews, Index = varCurrentIndex - 1, ID))
)
OnSelect of Next:
Set(
varCurrentIndex,
LookUp(colFilteredNews, ID = varCurrentNewsID, Index)
);
If(
varCurrentIndex < CountRows(colFilteredNews),
Set(varCurrentNewsID, LookUp(colFilteredNews, Index = varCurrentIndex + 1, ID))
)
Bonus Tip:
1. You can style your Next/Previous buttons using Power Apps standard Fluent icons: ChevronRight, ChevronLeft etc.
2. Disable the buttons conditionally:
Display mode of Next button:
If(varCurrentIndex >= CountRows(colFilteredNews), DisplayMode.Disabled, DisplayMode.Edit)
If(varCurrentIndex <= 1, DisplayMode.Disabled, DisplayMode.Edit)
"News " & varCurrentIndex & " of " & CountRows(colFilteredNews)
Please give the mentioned solution a try and let me know whether it works for you.
If it solves your issue, feel free to mark this thread as answered.
Please make sure to like the response!
Thanks!
- Hemanth Sai