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 / Icon for Changing to t...
Power Apps
Answered

Icon for Changing to the Next Record on an Edit Table

(0) ShareShare
ReportReport
Posted on by 33

Hey all,

 

Again, total newb here.

 

I have an edit form that comes from a home screen. I'd like the user to be able to switch to the next record for editing when they get to the edit screen.

 

Icon.png

 

table.pngI tried to use the updatecontext function but that doesn't yield the results I'm after.

 

Any help is appreciated.

 

Thanks

 

JT

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @DCGN2 

    If the numbers are truly sequential and numeric as they appear (and will stay that way), then you can do something like this in your Item property of your EditForm:

    Lookup(yourDataSource, Key=Coalesce(lclCurrentKey, 1))

    Then in the OnSelect of your "Next" Icon, the following:

    UpdateContext({lclCurrentKey: lclCurrentKey+1})

    Of course, change yourDataSource to be the datasource for the EditForm.

    Also, none of this takes into account going beyond the last record, but perhaps we cross that bridge when we come to it.

     

    I hope this helps get you to the next level.

  • DCGN2 Profile Picture
    33 on at

    @RandyHayes 

     

    So I tried to put in the code you mentioned but "lclCurrentKey" wasn't selectable, so I went with this and it's giving me an error:

     

    Form Edit Error.png

     

     

     

     

     

     

     

     

     

     

     

    before, I had 

     

     

    BrowseIntoolsTracking.Selected

     

     

    ETA:

    I'd like to be able to maintain the ability to have the row picked on the previous screen to be the one that's editable on this screen, and then be able to go to the next one rather than have to go back, pick the record and hit edit.

     

    Thanks,

     

    JT

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @DCGN2 

    First - what is the error you are seeing?

     

    Next, lclCurrentKey was a context variable that you were to put in the OnSelect of your icon.  If you followed my steps, you would have first received the error that it was invalid...that was okay as putting the formula in the Icon OnSelect would resolve that.  Perhaps I should have told you to do the formula on the OnSelect first...oh well.

     

    So, you didn't mention that you have a Gallery that the user comes into the EditForm from.

    If that is the case, then you would probably want to base your edit form and "next" navigation off of the selection in the gallery.

    If so, then, on your Gallery OnSelect property (before your navigate statment) put in a Set(glbCurrentKey, ThisItem.Key)

    Now, on the Icon OnSelect property, put this formula - Set(glbCurrentKey, glbCurrentKey + 1)

    Now in the EditFirm Item property, put this formula - Lookup(IntoolsTracking, Key=glbCurrentKey)

     

    That should give you the next navigation you want - but again, no maximum record checking and all assuming that Key is numeric.

     

  • DCGN2 Profile Picture
    33 on at

    @RandyHayes 

     

    Thanks for your help, that makes a lot more sense.

    I am able to get the gallery and edit form to work but when I throw in that code for the icon, it seems like it's passing through the wrong argument type?

     

    glbcurkey error.png

     

     

     

     

     

     

     

     

     

     

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @DCGN2 

    What kind of column is Key?

  • DCGN2 Profile Picture
    33 on at

    @RandyHayes 

     

    it's supposed to be a number column... I just changed my code to this: 

    Set(glbCurrentKey, Text(glbCurrentKey + 1))

    and it works now.

     

    Thanks!

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @DCGN2 

    Sounds like progress!!

     

    You might want, just for clarity in that formula, to make it:

    Set(glbCurrentKey, Text(Value(glbCurrentKey) + 1))

    This way we know we are adding numbers to numbers.  You'd be surprised by that, but these are the type of things that I uncover sometimes when people say "it worked fine last week", or "it works on this browser but not this one", etc.

     

  • DCGN2 Profile Picture
    33 on at

    @RandyHayes 

     

    good catch, I'll make sure to define it as a number.

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard