Post Non-Input data with Input data to Database Collection

I’m a beginner and developing a separate page for each of my sales people. On each sales person page are User Input boxes for visitors to that page to provide their first and last name and email address. The input boxes on all sales person pages are connected to a single Collection (dataset) named Master_Database. Entries are posted upon clicking a Submit button that is also connected to the dataset. No code required and it works great on each sales person page.

Now, along with posting the inputted names and email address, I need posted at the same time, in the same row , some non-input data specific to each page, that will indicate who’s sales person page the input data originated from (salesPersonName) and that sales person’s email address (salesPersonEmail). I can affix that data unique to each page in any form necessary (such as text, a text box, etc.) on the page. It can be shown, hidden, expanded, or collapsed. Whatever works, but preferably hidden or collapsed. Or it can be in some code. It just needs to post on the same row as the inputted data. The resulting Collection would look something like this:

The following code works, but does not post on the same row.

import wixData from ‘wix-data’;

export function buttonSubmit_click(event, $w) {
let toInsert = {
“salesPersonName”: “Jill Hill”,
“salesPersonEmail”: “JH@gmail.com
};
wixData.insert(“Master_Database”, toInsert)
.then((results) => {
let item = results;
})
.catch((err) => {
let errorMsg = err;
});
}

I tried simply connecting some paragraph text to the dataset, but it would not post. Even tried adding a couple of input boxes with the code below to automatically enter the page specific data, but they would not post either.

export function inputNAMEfirst_change(event, $w) {
$w(“#input4salesPersonName”).value = “Jill Hill”;
$w(“#input5salesPersonEmail”).value = "JH@gmail.com ";
}

Have spent hours searching for solution. Any help would be greatly appreciated.

1 Like