How to add hidden content values to repeated inputs and insert them to database?

Hello All, I have 2 databases with references to each other.
When the filled in the required information and submitted, database1 has a new record and the user is transferred to second page.
the second page has repeater element with input fields and also he can add more repeater items by using customized “add step” button.
the filled items eventually need to be submitted to the database2 and referenced to database1.
i am storing in the local storage a name from database1 and get that name in the second page.
there are 2 values i need to add automatically and submit to database2 without the user awareness,

  • step item number
    -reference item
    as you can see in the code below, i have wixData.insert of the itemData objects from the repeater, but i’m not sure how to add that 2 values i need into that itemData object,
    any way, even work around will be much appreciated!!


import wixData from 'wix-data';
import {local} from 'wix-storage';

var stepNumber = 0;
var protocolName = local.getItem("itemName");    <------- Here i'm getting my item name from the main database

$w.onReady(function () {

    $w("#repeater1").onItemReady( ($item, itemData, index) => {
 const repeatedStepNumber = $item("#stepNumberText");
        repeatedStepNumber.text = stepNumber.toString();
        console.log("Step added")

    $w("#repeater1").onItemRemoved(($item, itemData, index) => {
        console.log("Step removed")

    $w("#addStep").onClick( () => {

    $w("#removeStep").onClick( () => {

    $w("#finishButtom").onClick( () => {
        $w("#repeater1").forEachItem( ($item, itemData, index) => {
           if ($item("#description").text !== null) {
                console.log("Submitting: ")
                wixData.insert("Protocolsteps", itemData).then((results) => {
                    let item = results;
                    console.log("Submitted: ")
                }).catch((err) => {
                    let errMsg = err;
                    console.log("Failed to submit: ")
            else {
                console.log("description is null at item: " + itemData._id)

export function add_click(event) {
 let repeaterData = $w("#repeater1").data;
 let length = $w("#repeater1").data.length;
 let newId = Number(length + 1);
 let newlet = {
        _id: `item${newId}`
    $w("#repeater1").data = repeaterData;

export async function remove_click(event) {
 let repeaterData = $w("#repeater1").data;
 await repeaterData.pop();
    $w("#repeater1").data = repeaterData;