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 / Add a Button to goto t...
Power Apps
Answered

Add a Button to goto the next item in a table or data base in a form

(0) ShareShare
ReportReport
Posted on by 97

Hi im after a way to add a next item button in a form I'm using a table on one screen and a form on another but i have to go back to the first screen to select the next item how would i go about having two buttons that navigate in my table or data base that move to the next item or back a item? Thanks

David1966_1-1711839471665.png

 

David1966_0-1711839425512.png

 

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @David1966 - one method is use a Variable.

     

    For example, on the OnSelect property of your "Next" Button, enter:

     

    UpdateContext(
     {
     _ctx_Index: If(
     _ctx_Index <> 2000,
     _ctx_Index + 1,
     _ctx_Index
     )
     }
    );
    UpdateContext(
     {
     _ctx_record: Index(
     'Your Data',
     _ctx_Index
     )
     }
    );
    //the above assumes you have set an upper delegation limit of 2000 via settings

     

    On the OnSelect property of your "Previous" Button, enter:

     

    UpdateContext(
     {
     _ctx_Index: If(
     _ctx_Index <> 1,
     _ctx_Index - 1,
     _ctx_Index
     )
     }
    );
    UpdateContext(
     {
     _ctx_record: Index(
     'Your Data',
     _ctx_Index
     )
     }
    );
    

     

    On the OnVisible property of the Screen where the Edit Form Control is located, enter the below to reset the Context Variable back to 1.

     

    UpdateContext({_ctx_Index: 1});

     

    On the Item property of your Edit Form control, enter:

     

    _ctx_record

     

    Notes: 

     

    • As you might have guessed, the Index function is not delegable. The maximum upper bound is 2000.
    • There is currently not an out of the box way to Index a data source without using a workaround such as a creating a Collection with an index included. As a result, if you attempt for example to select an Item from the Gallery, the context variable in the Form Screen will not update itself with the Index number of that selected item. There is of course a solution to this as well if you need it, but for now I have provided a basic example above.
  • David1966 Profile Picture
    97 on at

    Thanks It work just a typo  "OnVisible" you meant "OnSuccess"

  • David1966 Profile Picture
    97 on at

    Problem is now table not going to the Form corresponding with that item ID they all goto the one item.

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @David1966 - No I did actually mean OnVisible, this is to optionally ensure Context Variable has a value whenever that screen is navigated to.

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @David1966 - sorry I do not understand what this comment means.

  • David1966 Profile Picture
    97 on at

    Not seeing OnVisible option is this on the table or form?

  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @David1966 - the OnVisible property is scoped to the Screen.

     

    Amik_0-1711915621503.png

     

     

    To understand the purpose of the OnVisible property, please see here:

     

    https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/control-screen 

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