Containers and Flexboxes - do they need to be referenced?

If I am trying to get a value from a field on a form and it’s either inside a flexbox or container, do I need to reference the container or flexbox in code?

For example, can I do this:

myVariable = FirstName.value

or does it have to be be:

myVariable = flexbox.FirstName.value?

Thanks for your answers.


Names of all controls are unique - so

myVariable = FirstName.value

is correct.