Data collection enter informations

I would need help to be able to have the information about the product that the people are entering their names on in my data base.

Because everything works well, but when people enter their name and the quantity they are offering, I don’t see this information is link to which product in the data base. I just see all the names and quantity. But I would need to still see the product linked to this information.

thank you

You will have to save manually and include a predefined variable that contains the name or add a hook which gets the current url and then add the product name. Either option will work

hi,

thank you for your answer. would it be possible to have more information to how to do it please, I am sorry but I am not sure to exactly understand how to do this.

thank you

You have to create your object then use the save function to save it, make sure to create your button event on click and add the code inside. And change both inputs to macth nom et qte

import wixData from 'wix-data';


fuction onOfferButtonClick (event) {

let toSave = {

item: $w(#dataset1).getCurrentItem.title,
nom:  $w(#nom).value,
qte: $w(#qute).value}

wixData.save("Data", toSave)
	.then( (results) => {
		let item = results; //see item below
	} )
	.catch( (err) => {
		let errorMsg = err;
	} );
}
/*  item is:
 *
 *  {
 *    "_id":          "rifk4nrk-dj4o-djhe-oidk-fnoqw4oiglk4i",
 *    "_owner":       "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb",
 *    "_createdDate": "2017-05-24T12:33:18.938Z",
 *    "_updatedDate": "2017-05-24T12:33:18.938Z",
 *    "item":        "item",
 *    "nom":   "John",
 *    "qte":    "5"
 *  }
 */
 

Hi, is it possible to do it for me in my data collection data because I think I have difficulty understand exactly how to do it. I tried but doesn’t seems to work - I think I did not understand exactly. thank you