Hi,
I would like to submit data to the database with the code (for some reasons I cannot use a button with a Submit function). I am trying the following structure:
Hello konrad.kostrzewa,
this little piece of code should help you…
export function button2_click(event) {
$w('#dataset1').setFieldValue("video", "xxxxxx")
$w("#dataset1").save()
}
The action is fired by an click on the button called ----> “button2”.
$w('#dataset1').setFieldValue("video", "my new value")
Here you have the connection to yout dataset (in this example —> “dataset1”).
With this command you [sets] a [FieldValue] to a specific REFERENCE (“video”) with the new value (“my new value”) into your DATA-COLLECTION…
$w("#dataset1").save()
and then save it.
EDIT:
And if you would use the searchbar, i am sure you would also find some posts like this one…
…in this forum!
Or just take a look into the “Corvid-API-Reference” here…
Thanks. I tried that and it does not work Do you have any idea why? There are no new records in the database after clicking on the button. I checked the database permissions as well
Is your dataset set to write only? Have you checked the logic of your form? For, example of set to read and write does the record exist before attempting to update it?