web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Controle próximo item ...
Power Apps
Suggested Answer

Controle próximo item no detalhamento

(0) ShareShare
ReportReport
Posted on by 15
Tenho uma tela e Galeria, que lista notícias de uma lista sharepoint. Ao tocar no titulo notícia vamos para o detalhe desta, a notícia em sí. Quero colocar um ícone ou botão que dentro desta notícia e respeitando o filtro da galeria, o usuário possa navegar para a próxima notícia ou a anterior a esta. Baseado no estilo Padrão Power Apps de lista em galeria e detalhe. Queria implantar a princípio controle gestual, mas vi que não há esta possibilidade.
Alguém já se deparou com situação semelhante ?
 
Categories:
I have the same question (0)
  • Suggested answer
    Power Platform 1919 Profile Picture
    1,890 on at
    HI @ ,

    This can be easily achieved with collection and index of the current news item.

    Although Power Apps doesn't support gesture/swipe controls for this yet, you can easily add navigation buttons to cycle through the news items while respecting filters. Here's how you can implement it:
    Your Scenario:
    You have a Gallery that displays filtered news items (from SharePoint).
    You have a Detail Screen that shows one selected item.
    You want Next and Previous buttons on the Detail Screen to navigate through the gallery-filtered list.

    Step 1: Generate a Row Index number for Sharepoint News data source if not done already:
    Example : 
    With(
        {
            prodCountRow: Filter(
                'Sales Data',
                StartsWith(
                    'Product Name',
                    txtSearchProduct.Value
                )
            )
        },
        ForAll(
            Sequence(CountRows(prodCountRow)),
            Patch(
                Last(
                    FirstN(
                        prodCountRow,
                        ThisRecord.Value
                    )
                ),
                {ProdRowNumber: Value}
            )
        )
    )

    Step 2: Track Current Item in a Variable:
    On selecting a gallery item:
    Set(varCurrentNewsID, ThisItem.ID);
    Navigate(DetailScreen, ScreenTransition.Fade)
    

     

    Step 3: Load Current item in the Detail Screen:
    Set the item property of your form or detail controls on the DetailScreen to: 
    LookUp(colFilteredNews, ID = varCurrentNewsID)
    
    Step 4: Add "Next" and "Previous" Buttons: (Here colFilteredNews is a sample collection storing news data)
    OnSelect of Previous :
    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)
    
    Display mode of Previous button:
    If(varCurrentIndex <= 1, DisplayMode.Disabled, DisplayMode.Edit)
    
    3. You can optionally show current position like:
    "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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard