Keeping rows together when new data added

My app tracks miles for a challenge. It imports user name and goal and alphabetizes via a query from a data sheet. There’s a third column for miles which is entered from the app by user.

Problem: how do I keep the miles with the correct user when new data is added? Currently, when a new name is added the NAME and GOAL columns are re-alphabetized. But the MILES data doesn’t stay with its owner.

Thanks for any help.

What’s the purpose of creating a separate sheet via a query? Mixing rows created from a query with other columns filled from the app will get you in a whole lot trouble since there is no link between the queried data and the non-queried data.

Are you trying to sort your data for use inside the app or use outside of the app? Any reason for not using the apps built-in sorting functionality?

That’s EXACTLY my problem!

Apparently the built-in sort is new? I’ll do some research, but here’s what I see as an immediate problem.

I’m not showing last names, just first name & last initial. So not sure how sort will work. Thanks for pointing me in that direction.

Can the app sort on a column that’s not displayed?

Maybe make it increment the miles under the same user instead of adding additional logs.

Sort has been there at least a couple of years as far as I know. Definitely not new.

You can create a template column of First/Last or Last/First and use that template column to sort your list.

I would completely avoid using a query sheet if at all possible. You already have the data in the original sheet, so that is where you should be updating the miles.