How to reference a similarly named group variable in xlsform

I've wondered if variable names had to be unique to the whole xlsform, or just within the scope of the group that the variable is in. Several hints seem to point at the latter...


  1. I noticed that group names are appended to variables when I export from aggregate to CSV
  2. I've been able to successfully generate an XML file from a form with same variable names, where
    each variable is in different groups

So, if this "is" possible, given the example below, how do I reference one of the variables in ${...}?
Is the acknowledge part of the xlsform example below correct? The offline xlsform converter does not like it.


type, name, label
begin group, g3
text, number, Choose your number!
end group

acknowledge, num_acknowledge, Your choice was ${g3.number}

If you are using XLSForm, pyxform checks for uniqueness across of variable names in the entire form. I believe that if you are using XForms, names have to be unique within the group. I say believe because I have not tried this myself, but your testing suggests that my belief is correct.

Given that XLSForm checks for uniqueness, there will need to be a change in pyxform to enable what you'd like to do. You can file an issue at so pyxform's developers can discuss it.