Back

Store in appwrite database

  • 1
  • Web
bharath
2 Apr, 2023, 07:52

I want to store different types of user input from different components of my project like in signup component I want to store username,email and in another component I want to store different types of data

TL;DR
The user is trying to store different types of user input from different components of their project in an Appwrite database. They have successfully stored username and email in the signup component but are unable to store user input from other components. The error message they are receiving is "AppwriteException: Invalid document structure: Missing required attribute." The recommended solution is to either mark the color and side attributes as not required or provide a default value.
bharath
2 Apr, 2023, 07:53

@Binyamin could you please help me

safwan
2 Apr, 2023, 08:47

just create a Collection with the data you want to store

bharath
2 Apr, 2023, 08:54

I want to store username,email,some user inputs of different components in my document

bharath
2 Apr, 2023, 08:55

Iam able to store username and email and If iam trying to store user input from different components iam unable to do that

Arth
2 Apr, 2023, 09:23

Why are you unable to do that?

Arth
2 Apr, 2023, 09:24

Provide more context please

bharath
2 Apr, 2023, 09:26

In signup component I have created database

bharath
2 Apr, 2023, 09:26

And in another component iam unable to do that

Arth
2 Apr, 2023, 09:27

Share code please

Arth
2 Apr, 2023, 09:28

And why are u unable to do that, are you getting any errors?

Arth
2 Apr, 2023, 09:28

Please be a bit more clear

bharath
2 Apr, 2023, 09:30

this is my signup component

bharath
2 Apr, 2023, 09:31

this works good but when i do this same thing for another compoents to store different user input iam unable to do that

safwan
2 Apr, 2023, 09:40

what's the error that gets thrown?

bharath
2 Apr, 2023, 09:50

AppwriteException: Invalid document structure: Missing required attribute

bharath
2 Apr, 2023, 09:51
darShan
2 Apr, 2023, 09:58

If color and side are marked as required and you do not pass that info while creating the document, you will probably receive Missing required attribute exception!

darShan
2 Apr, 2023, 09:58

Either mark them as not required or pass that data when creating the doc.

bharath
2 Apr, 2023, 10:01

when i marked as not required iam not getting AppwriteException: Invalid document structure: Missing required attribute error

safwan
2 Apr, 2023, 10:01

exactly

safwan
2 Apr, 2023, 10:01

if you've marked it as required, you need to give it a value when creating a document

bharath
2 Apr, 2023, 10:01

not storing the value of color and side in appwrite

darShan
2 Apr, 2023, 10:02

or you can provide a default value as well.

bharath
2 Apr, 2023, 10:02

was storing username and email but not storing color and side

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