
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
- Is my approach for deleting registered u...
A few weeks ago, I was advised not to use the registered users' id in my web app. Instead, I store the publicly viewable information such as username and email ...
- Stuck in "deleting"
my parent element have relationship that doesnt exist and its stuck in "deleting", i cant delete it gives me error: Collection with the requested ID could not b...
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
