Node Editor TextField data

Hello,
I’m currently working on creating a node based editor for a dialogue system, which will be used for creating a Visual Novel. The issue that I’m having is that I can’t seem to gain access to the TextField value. I know that this:

textField.RegisterValueChangedCallback(evt =>
{
node.DialogueText = evt.newValue;
});

Works in terms of creating an individual Text Field, however in my case I’m trying to gain access to multiple TextField data; shown in the attached image below.

5818255--616390--Capture.PNG

By clicking on the “Dialogue +” button, a new TextField will be generated into the node’s main container. So in the end I’m trying to do is gain access to each TextField’s data so that I can save them into an asset file.

If you have any knowledge on how to do this, please feel free to comment below.

Right now I’m using this bit of code below to temporary solve my problem but it is messy and not very reliable.

string parentS = “”, childS = “”;
for (int i = 0; i < _narratorNode.mainContainer.childCount; i++)
{
if (_narratorNode.mainContainer.ElementAt(i).GetType() == typeof(TextField))
{
var p = (TextField)_narratorNode.mainContainer.ElementAt(i);
parentS = p.value;
for (int j = 0; i < p.childCount; i++)
{
if (p.ElementAt(i).name ==“Narrative”)
{
var c = (TextField)p.ElementAt(i);
childS = c.value;
Debug.Log(childS);
}
}
}
Debug.Log(parentS);
}