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
- Issue with downloading large files (40GB...
Hi everyone! I am using the latest Appwrite 1.8.0 version on my self-hosted server. I successfully uploaded a large ZIP archive (~40GB) using the chunked uploa...
- Cant get realtime working
Hey I nned some help with realtime a gain. I was using client.subscribe(...), and i found out that its depricated then i believe realtime.subscribe(...) is the ...
- Hi Folks, Database Writing Issue
Hey Folks im trying to get logging setup on my website but im getting an error, i dont have any document id and i think this is the issue but i havent got the f...