
Ok I will wait for you

Iam struggling with this issue from past 2 weeks

This is my appwrite component

This is my signup component in which username and email will be stored

This is my select.js another component in which I want to store user input through radio button . Here iam using updatedocument

This is the simulation example of create account. and every there is new user in your backend, our function will be triggered


This is the code how I did implement the funciton https://gist.github.com/moshOntong-IT/6ba791ddd1b3f1b4b758e44e1148152b

And if you are not familiar with appwrite function, there is a resources on internet on how to use the appwrite function, and if you are ready to go like you are already familiar with appwrite function, just mention me there and I will help you

Iam new to appwrite I don't know about it

Did you understand my issue

- I have signup page in which username and email will be stored. Here I have used createDocument

- In another component (Select.js) in this component user input through radio buttons . Here I will updateDocumnet but I need documentid to do that as this is another component I need documentid

yeah, I did understand the issue here. But what I did is that to optimize your code, function will be the first step of our path way to solve your problem.
Because I believe even you store your DocumentID in your browser something like cache in web, the problem here is that what if the user refresh or exit the website? So the DocumentID stored in your cache will be deleted. Therefore I recommend you to use a cloud function to shorten your code. Because we can take advantage the account.get()
method. Because if we use this method it will always return an User Object and we can use the $id attribute here, and treat this $id as your DocumentID. Because in our cloud function implementation we have this code
const userObject = JSON.parse(req.variables["APPWRITE_FUNCTION_EVENT_DATA"]);
console.log(userObject);
try {
const result = await databases.createDocument(
"64397a645b2d0000f2e0",
"64397a6ec7fce839a55c",
userObject.$id,
{
name: userObject.name,
email: userObject.email,
}
);

I have no idea about cloud functions

Please take a look the encircle in our image attached. I did not use the ID.unique as our Document ID when creating a user account, Instead I use the $id of our User Object

Yes I have seen

If that case okay then I will modify your code.


This is my githib repo

In this I want to store user input from different components

const register = async (email, password) => {
try {
const account = new Account(client)
const result = account.create(ID.unique(), email, password)
console.log(result)
} catch (error) {
const appwriteError = AppwriteException;
throw new Error(appwriteError.message)
}
}
I just modify your register method , I put a result and console log here, and I temporarily remove the return here. Can you please screenshot the log in devinspector

- Username and email (signup.js)
- Filename (Uploadcomp.js) 3.Color,side (Select.js)
- Table values (Showprice.js)

This user inputs I should store

Have you gone through it
Recommended threads
- how many Teams can be created?
I am creating an app where I will let users create groups. This could mean there will be many groups created by user, to isolate those groups properly I am thin...
- React native app login via Safari
Hi! I deployed for debug my React Native app in web, chrome everythink works well but in safari on mac and ios I cant login. I found this one error in safari co...
- Relationships restricted to a max depth ...
When I do query like: ``` await _databases.listDocuments( databaseId: AppwriteConfig.DATABASE_ID, collectionId: AppwriteConfig.SERVICES_COLLECTI...
