cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DCGN2
New Member

Icon for Changing to the Next Record on an Edit Table

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

1 ACCEPTED SOLUTION

Accepted Solutions

@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.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

8 REPLIES 8
RandyHayes
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@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

@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.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@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

 

 

 

 

 

 

 

 

 

 

 

@DCGN2 

What kind of column is Key?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@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!

@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.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,833)