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 / Form Next record button
Power Apps
Answered

Form Next record button

(0) ShareShare
ReportReport
Posted on by 24

I have a display form that I want to add a button to take the user to the next record from the list.  I am new to powerapps and not sure how to accomplish this.

Categories:
I have the same question (0)
  • Verified answer
    Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @ksmith23 

    Here's a start. You can have your selected record as a variable (for this example let's call it varRecord).  Then in your Next button you can add a function to go over the next record.

     

    UpdateContext({varRecord:LookUp(YourDataSource,ID=varRecord.ID + 1)})

     

    Adrian_Celis_1-1647826414845.png

     

     

  • ksmith23 Profile Picture
    24 on at

    How do I set the variable for the form on the Items?  I am not sure of the formula I need to use.

  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @ksmith23 

     

    For example, if you have a gallery for your data source in the same screen, you can have a button in a gallery and on its OnSelect property, you can set a variable named varRecord like:

    UpdateContext({varRecord:ThisItem})
  • TimothyTrimble Profile Picture
    14 on at

    Is there any other action needed? I added two icons to the top of my details form and added the functions. Nothing happens when selected. 

    TimothyTrimble_0-1684870283461.png

     

  • Blarue Profile Picture
    76 on at

    Same here, what step is missing?

  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @TimothyTrimble @Blarue 

    Late reply. But did you put varRecord in the Items property of your form?

  • Blarue Profile Picture
    76 on at

    @TimothyTrimble I found another way to achieve this same effect.  its a bit more work but it may be due to the fact that my gallery is filtered, not sure but here it is. 

    My Gallery has a button/Icon with OnSelect property set to Select(Parent) and navigate to the screen with the edit form.

    The Edit form's screen has it's On Visible property set to Set(varRecord, MyGallery.Selected.ID)

    On my next button/icon I have on the OnSelect property 

    Set(varRecord,Min(Filter(MyGallery.AllItems,ID > varRecord),ID))

    and on the my back button/icon' OnSelect property Set(varRecord,Max(Filter(MyGallery.AllItems,ID < varRecord),ID))

    And lastly, my item property on my form is set to LookUp(MyDataSorce ID = varRecord)

  • RobinHan Profile Picture
    4 on at

    Hi, thanks. but how about if the data source record were deleted, so the record ID will  not be continue. 

    then this way via the ID +1 or -1 should be not work perfectly. any other better solution? 

  • KI-13090739-0 Profile Picture
    12 on at

    you are absolutely right. That was also my first thought

  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @RobinHan 

    Good point.

     

    Approach 1:

    You can do this approach, but this has a delegation limit

    Previous button

     

    UpdateContext({varRecord:First(Filter(Sort(MyDataSource,ID,SortOrder.Descending),ID < varRecord.ID))})

     

    Next Button

     

    UpdateContext({varRecord:First(Filter(MyDataSource,ID > varRecord.ID))})

     

     

    Approach 2:

    Get the next/previous item by Created date. This will not work if your items are created in bulk at the same time

    Previous Button

     

    UpdateContext({varRecord:First(Filter(Sort(MyDataSource,ID,SortOrder.Descending),Created < varRecord.Created))})

     

    Next Button

     

    UpdateContext({varRecord:First(Filter(MyDataSource,Created > varRecord.Created))})

     

     

    Approach 3:

    You can have a helper column that is a number type. Everytime you patch, you patch a sequential number in that column. This will not have the delegation warning. Let say we call our helper column Sequence.

    Previous Button

     

    UpdateContext({varRecord:First(Filter(Sort(MyDataSource,ID,SortOrder.Descending),Sequence < varRecord.Sequence))})

     

    Next Button

     

    UpdateContext({varRecord:First(Filter(MyDataSource,Sequence > varRecord.Sequence))})

     

     

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