Populate a dropdown with all member login emails for non-admin members to use

I’ve created a page and collection (“Member Files Private”) on my site to allow members with the role “instructor” to share files with specific members of my site.

The way the page works is as follows -

The instructor selects a user to share the file with (a dropdown populated from the “loginEmail” field of the “MembersPrivateData” collection).
They then enter a title for the file.
They select the filetype (document/audio/video/image).
Then select a file to upload.
Finally, the “instructor” will click upload and the selected file will be saved into the “Member Files Private” collection, with a “member email” field in the same collection being filled with the email selected from the dropdown.

The target member can then view the files shared with them on another page that shows the contents of the “Member Files Private” collection filtered by the login email of the current user.

Everything functions as it should, except for one thing.
Any “instructors” that aren’t Admins only see their own email in the dropdown.
Is there any other way to populate the dropdown with the members login emails that will allow non-admin members to see them?

Thank you in advance.

You can use code to query the member database and get the emails from it and put it inside the drop-down. This is the method I will use as I prefer coding.

But also check if there is any dataset filter applied to to your members dataset and remove it. Maybe it will work after it.

There are no filters on the MembersPrivateData and I’m able to see everyone’s login emails in the dropdown if i am logged in as myself or any other admin user.

It’s only if I log in as a non-admin that the dropdown only shows the logged in users email.

I did think of querying MembersPrivateData to populate the dropdown, but I’m relatively new to wix and havent had much luck finding any info on the topic (all the results just point me to doing it through the editor rather than code, which is how i’m already doing it) or in trying to work it out through experimentation.

Is there anywhere you could point me to that might help?

Ok. No problem. You can learn coding with the Corvid API reference page.

After reaching there search for query and you will find examples how to do it. If you need my help to do this let me know. I can implement it in few minutes.

Thank you, I’ll have a look and see if I can work it out and report back.