Skip to content
Init is coming / May 19 - 23
Back

Get userName from userID

  • 0
  • Flutter
lemonjoe
8 Jun, 2023, 20:55

I need to read out the username for specific userIDs in a list. How can I do this? Can I somehow do something like database.getUserName('userIDStringHere')?

TL;DR
To retrieve the username for specific userIDs in a list, you can use the Query.equal function on a user data collection. However, this approach may only be usable on the Server API, not in Flutter. If you are using Appwrite, you can refer to the server-side SDK documentation (in this case, the example provided is for Node.js) at this link: [Server SDK - Users Get](https://appwrite.io/docs/server/users?sdk=nodejs-default#usersGet) Based on the documentation, you can use a function like database.getUserName('userIDStringHere') to get the username for a specific userID.
lemonjoe
9 Jun, 2023, 11:59

Somehow... But is it only usable on Server API and not in Flutter?

Asutosh
9 Jun, 2023, 12:34

if you have the user data in a collection you can add a query like Query.equal(userId, 'userIDStringHere') to list documents and from result you get the username

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more