Accessing group components in a loop

I have a screen in Vision that has 15 rows of 6 text fields each. I'd like to populate these text fields with preexisting data upon loading the page, so I have the below script as an internalFrameActivated script, but I'm having trouble figuring out how to actually access the components in this way. I keep getting an error about doubleValue not existing for Type: None.

Is it possible to access components in this way, or is there a better way to do it?

if system.gui.getParentWindow(event).getComponentForPath('Root Container').updateFlag == True:

    existingDataset = system.tag.read('[client]QC/VeneerThicknessCheck/UpdateExisting/ExistingDataForUpdateQuery').value
    

    field_map = {
    
        "tail": "TailField",
        "center": "CenterField",
        "head": "HeadField",
        "average": "AverageField",
        "length": "LengthField",
        "width": "WidthField"
    }
    
    rows = 15
    fields_per_row = len(field_map)
        
    #Loop through all 15 rows, set all values to 0
    for row in range(rows):
        #group_component = event.source.parent.getComponent("Root Container.Group %d" % group_number)
        groupVal = row + 1
        group_component = system.gui.getParentWindow(event).getComponentForPath("Root Container.Group %d" % groupVal)
        system.gui.getParentWindow(event).getComponentForPath('Root Container.Group 1.AverageField').doubleValue
        #group = {}
        
        for field_index, field_info in enumerate(field_map):
            system.gui.messageBox("field_index: " + str(field_index) + "field_info: " + str(field_info) , "DEBUG")
            component_name = field_info
            system.gui.messageBox("component_name: " + str(component_name), "DEBUG")
            data_index = (row * fields_per_row) + field_index
            system.gui.messageBox("data_index: " + str(data_index), "DEBUG")
            value = existingDataset[data_index]
            system.gui.messageBox("group component: " + str(group_component), "DEBUG")    
            #system.gui.messageBox("group_component.getComponent(component_name): " + str(group_component.getComponent(component_name)),"DEBUG")
            system.gui.messageBox("group_component.getComponent(component_name): " + str(group_component.getComponent(component_name)),"DEBUG")
            group_component.getComponent(component_name).doubleValue = value
            system.gui.messageBox("Row: " + str(row) + ". Component Name: " + str(component_name) + ". Value = " + str(value), "DEBUG")
            

This means one of your component resolutions is returning "None" (Python's name for null), meaning "there was no component by that name to find".

One of these; without the line number it's hard to say which.

This either means there's a typo, discrepancy in your naming convention, whatever.


With that said...

Repetitive, formulaic data entry that fits a distinct model sounds like a job for a Table, not a mish-mash of components in different containers that you have to be sure to name and arrange just right. Building and assembling a dataset is ~easy, especially with a database involved.

I second that it should probably be at able since its just a text field but if you still really want the text field or in other scenarios yo have a different non-table friendly component, go through the trouble of crafting a expression. Create a root container custom property that binds to your dataset, lets call it initialData.

Then under each text field make a custom property initialValue that is defined like

try({Root Container.initialData}[someRowValue, 'someColumnName'], 'fallbackValue')

Then bind your text property to this.

If it is formulaic then the row value and column name are predicatable, make a template with params that accept that a rowNumber and columnName param and use that in the expression, then use a template repeater to make your 15 rows by 6 columns.

Having said all that, if it really is just a text field I would definitely lean towards a table.