Open next user's page, alphabetically

Hi folks. Problem I can’t solve…
I have an app with student users and admin users. I want the admin users to be able to click on a link in the header or on one student’s page and go to the next student’s profile page, alphabetically. I have a list of student users per department, but it’s not sorted alphabetically in the database. So if an administrator is on Jane Doe’s profile page, how can I design a workflow so a “Next Student” button takes them to Jeremy Doku’s page?
Thanks!
Fred

Let me try to set up an example for you. :blush:

I think this is the simplest way to do it. It really depends on how you have things set up though. Check it out.

Editor: testApp42wCleanDB | Bubble Editor
Preview: https://testapp42wcleandb.bubbleapps.io/version-test/open_next_user_s_page__alphabetically?debug_mode=true

Does that work for you?

Hey @J805 Thanks very much. I want to open a page with type User and send the user as the data in the Go To Page action .
Maybe I could have an invisible repeating group of all the students in that department, sorted alphabetically. On page load, I’d show the current Page’s User in that invisible RG and then on the Next Student workflow start by showing the next user and then in the Go To Page action, include the user shown in that RG as the data to send.
Do you think all that will work in an invisble RG?
Cheers!!
Fred

I think it’s a possibility. It’s worth a shot. :blush:

This doesn’t work. I’m at a loss here. I just need to be able to have an alphabetical list of users and search and find the next one. Surely this can be done! Maybe with a URL parameter that’s an index and I just refer to the user by that index+1?

Hi Prog,

This might help. It’s very simple to look up a list of users (“students”) in an RG and sort alphabetically. I did it like this:

Then all you would have to do is to have the text element active to go to their page upon clicked or the next page in the RG (index+1). … This might be a start, see if that helps.

I use this to create an RG with an alphabetized list of students associated with 1 teacher and then display each student’s progress.

Dana :slight_smile:

I figured it out.
Each of my university departments has a List of Users. When the popup is opened, I send that list of users to the popup, sorted alphabetically, as a state (department_students). I also send the user that was clicked on (current_user). So then I use @eli 's great 1 Thing Plugin (1 Thing Plugin - Index Finder - Get the index number for any item in your list). When the user clicks Next Student, the first action is to use the plugin action to find the index number of the current_user state in the department_students list state. Then the next action in the workflow displays data in the popup: department_students item # result of step 1’s index# + 1. And vice versa for Previous Student -1.

Fantastic!
Thanks everyone, especially the legendary Eli.