Back

how to store user input in appwrite

  • 1
  • Web
bharath
4 Apr, 2023, 11:53

iam trying to store user input from different react componets but i was unable to store in appwrite. but i was able to store the inputs of only one components. 1.i have created seperate file for appwrite initialisation. 2.i have used createDocument only once after that i used updateDocument.even though iam unable to store .

TL;DR
The user is having trouble storing user input in Appwrite. They are receiving a document ID, but they don't know how to save and use it in another component. The solution is to use the `createDocument` function to get the ID, save it, and then use it with the `updateDocument` function.
bharath
4 Apr, 2023, 12:34

@Binyamin please look at it once

Binyamin
4 Apr, 2023, 12:38

It's looks like the same issue we have dealt couple a days ago? If so then what you need to do is to get back the ID from the createDocument, save it then use it with the updateDocument function

bharath
4 Apr, 2023, 12:40

how to save the id ???

Binyamin
4 Apr, 2023, 12:41

When you use the createDocument you get back the object https://appwrite.io/docs/client/databases?sdk=web-default#databasesCreateDocument

bharath
4 Apr, 2023, 12:42

yes iam getting document id in my console as an object but how to save and use it in another component

Binyamin
4 Apr, 2023, 12:44

You'll need to send back the info to your react parent-component which then send it to all the child components

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