I want to fetch other user data using its userid but i can't achive it due to if i use account.get it will return current logged user to me what to do to get other user data with its userid.
From a Client SDK you can’t get data of other users.
then where to get??
can u share resources to get through it
You could create a Function which uses the Server SDK to call the users.get()
method. Just make sure you set correct permissions on the Function, and only return the fields you really need.
let me work on it.
Why?
Actually I'm building a blogging website where I need this feature to fetch user details using its userid
Why do you need to fetch user details?
I want that to user can view others profile 🤔
The typical approach to this is to create a Profiles collection for what should be visible. The built in users is not publicly accessible because there's a lot of private data in there
You can set up a function to automatically populate and update the documents in the profiles collection
Ohh should I create function which is store all new user public data into a document and then access it with I'd great suggestion thanks Steven
But how do I get a foreign key reference to this private user table? Managing this using function seems really backwards.
That’s why I suggested a Function which only returns the required attributes
You’d set the Document ID to be the User ID, presumably
But as I see it, there is no way to actually get a link to the private user table. So they would just share the user ID and not actually be in any relationship, thus not guaranteeing data integrity.
Well, my understanding is that the officially recommended method would be to have a Function triggered on user data update
Yeah, it cause but we dosen't have any other option now
Recommended threads
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...