How to reference an input inside a repeat from outside the repeat

I have a form with inputs that are inside a repeat and have id’s like the following:
id="insp_OrderID" dmx-bind:id="insp_OrderID_{{$index}}"

And I have a var that captures the value of the index that the user clicks on like:
dmx-on:click="varOrderDetailsIndex.setValue($index)"

Now, outside the repeat, I have a button with an onclick that needs to check the value of the OrderID for the given index. When I use the builder to select the field, I get this:
modal_orders.form_orders.tableRepeat_OrderDetails[0].insp_OrderID.value

I tried replacing the 0 with the variable value like:
modal_orders.form_orders.tableRepeat_OrderDetails[varOrderDetailsIndex.value].insp_OrderID.value
But it doesn’t work. Any ideas how to go about this?

Unless I’m missing something, can’t you set the OrderID to a variable in the same why you’re setting the index?

No, because I need to change the value of the OrderID for the given index, when the button is clicked. So the user clicks on a row and that selects the index, then clicks this button and that will change the value of that row’s OrderID. Does that make sense?

It turns out I was really close, but missing the ‘items’ property of the repeat. You can reference the repeat values like this:
tableRepeat_OrderDetails.items[varOrderDetailsIndex.value].inp_OrderID.value

And I even discovered you can set the values as well:
tableRepeat_OrderDetails.items[varOrderDetailsIndex.value].inp_OrderID.setValue('value')

Sure would be nice to have documentation on what methods were available here.