[SOLVED] AppwriteException: Invalid document structure: Attribute "color" has invalid type.
- 0
 - Web
 
AppwriteException: Invalid document structure: Attribute "color" has invalid type. Value must be a valid string and no longer than 100 chars
once check my code
so when radio button selects a value -> you should be sending that back to update the DB about the color, empty string will be replaced by your color. I do not think the updation is happening and hence, it is showing error?
then what should i change in my code
    props.setSelectedValue(event.target.value);
    database({
      color:''
    }).then(function (response) {
          console.log(response);
      }, function (error) {
          console.log(error);
      });
}
const handleChange2 = (event)=>{
  props.setSelectedValue2(event.target.value);
  database(
    {
      side:''
    }
    ).then(function (response) {
        console.log(response);
    }, function (error) {
        console.log(error);
    });
}```
What logs you get for this part?
database({
      color:''
    }).then(function (response) {
          console.log(response);
      }, function (error) {
          console.log(error);
      });
black and white
Or
Color
What is the log of the database function
What is log
Do you mean console log
Yes
Users radio button input
Do you get error when running the database function?
Yes
What is the error?
Show me the payload inside the network tab
Ok
here it is
Okay, you're sending color as an object when it is a string Just change the value to string and you're good to go
closing as original message was deleted so i think it was resolved
[SOLVED] AppwriteException: Invalid document structure: Attribute "color" has invalid type.
Recommended threads
- Dynamic Roles
I tried to store a row with this permissions: permissions.push( Permission.read(Role.users("verified")), Permission.write(Role.label(`c-${calend...
 - appwrite auth problem regarding the sess...
Hi, I have problem with auth. When I try to login/signup using OTP, at the end session.secret is empty, i have searched online and in the docs but i cannot find...
 - log out failure
I am trying to set up the user sign up/log in/log out and while I have got the sign up/log in to work, log out keeps failing. i am keeping it simple with only r...