Need Help with "Cannot read properties of undefined " Loop query insertion to Firebase from multiple textinput

Hi All, I am trying to add queries to firebase by a loop.
I am using this code

for ( var i=0; i< listView2.data.length; i++){

    var textInputValues = listView2.data[i].textInput1;
    const data = {
      SpecialReq: textInputValues,
        }

  await db.firestore().collection('Ticket').doc().set(data);
}

but the error is coming out

TypeError: Cannot read properties of undefined (reading 'textInput1')

* * message:"TypeError: Cannot read properties of undefined (reading 'textInput1')"

I try to use it as
var textInputValues = listView2.data['0'].textInput1;
and the first item can be added to the database.

May I have any solution? thanks

Hi I fount out the question is because the inputtext value is not set and is a future variable even there is a default value.
And my solution when I click the button and set the variable as a temp value then change the code to be

  for ( var i=0; i< listView2.data[; i++){
    var textvalue = variable1;
    var textInputValues = textvalue.value[i].textInput1;
    
    const data = {
      SpecialReq: textInputValues,
      }