
const handleChange = (event) => {
event.preventDefault();
props.setSelectedValue(event.target.value);
const client = new Client()
client.setEndpoint('https://api.printfc.in/v1') // Your API Endpoint
.setProject('64242c801cdd58d2213');
const databases = new Databases(client);
const promise = databases.createDocument(
'6426fd4b827fedc4a235',
'6426fd9b65c0b7f2c561',
ID.unique(),
{
opt1,
opt2,
opt3,
opt4,
}
);
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
};

what is the type of the selected-value?

string

there is the error

{ "selected-value": "your fields here"
}

where should i add it

this is not a valid json:
{
opt1,
opt2,
opt3,
opt4,
}

??

`const handleChange = (event) => { event.preventDefault(); props.setSelectedValue(event.target.value); const client = new Client() client.setEndpoint('https://api.printfc.in/v1%27) // Your API Endpoint .setProject('64242c801cdd58d2213'); const databases = new Databases(client); const promise = databases.createDocument( '6426fd4b827fedc4a235', '6426fd9b65c0b7f2c561', ID.unique(), { "selected-value": "your fields here" } );
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
};`

what should i replace in "your fields here"

`const handleChange = (event) => { event.preventDefault(); props.setSelectedValue(event.target.value); const client = new Client() client.setEndpoint('https://api.printfc.in/v1%27) // Your API Endpoint .setProject('64242c801cdd58d2213'); const databases = new Databases(client); const promise = databases.createDocument( '6426fd4b827fedc4a235', '6426fd9b65c0b7f2c561', ID.unique(), { "selected-value": "{userId:12345,numberPages:10,numberCopies:2,Colorful:true,BothSides:false,fileId:abcdefg}" } );
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
};`

what value should i replace in userId and fileId

and should i set numpagesand etc to default

the fields you want to store

where does that fields present

no website

???

What is your frontend programmed for?

to upload files and to input the values

Hi @Bharath if no extra help is needed here can we close this?

I think you have mentioned wrong guy ๐

Sorry!

My apologies

[solved] 400() error....

[SOLVED] 400() error....
Recommended threads
- SSR Image Previews
I am using the SSR guide (with SvelteKit) to use Appwrite on both the server and the client. I do this by also passing the cookie back to the client and creatin...
- Multiple Set-Cookie headers collapsed on...
Iโm deploying a Next.js 15 app to Appwrite โ Deploy โ Sites. In app/api/auth/login/route.ts I try to set 3 cookies. Variant A (manual headers): const headers ...
- can't send emails
i explored the docs and it says Messaging.CreateEmail() but this function does not exist , i installed appwrite on next js env everything works fine except thi...
