Getting error on using distinct-values() function

Hi Team,

I am getting error on using distinct-values.
distinct-values(“a a b b c c c”)
join(" ",distinct-values(“a a b b c c c”))
it should return-> a b c

Thanks and Regards
Zeeshan Ahmad

Please help in this!

Hi Zeeshan

I have tested this in a form and it works fine. Where are you trying to use the expression?

I am trying in my local server.
I think i have old enketo xsl files.
Can you please help me to get new enketo xsl files?

I'm not sure about using Enketo XLS files with CommCare. How are you importing the form into CommCare?

I am creating form on Vellum and Rendering on enketo .

I don't think I can help with that problem. As far as I can tell that XPath expression works fine in CommCare. If it's not working in Enketo then you'd need to follow up with them.

They are not answering. Do you know any other forum ?

Hi Zeeshan,

Unfortunately we don't have any contacts with the Enketo team, but I believe that function may not be a part of their XForms library. CommCare has added a number of additional specification implementations over the years that may be unavailable in older specs.

As an alternative, in case you haven't seen it, CommCareHQ also supports a Web Entry Interface for CommCare Apps and XForms where all CommCare supported XPath functions should be available


Hi @Clayton_Sims

What are you using to render the form?

Thank you!

Hi Zeeshan

CommCareHQ has the ability to render the forms on the web (as shown in the link Clayton shared). You can read more about the technical details in the CommCare HQ technical documentation: Web Apps JavaScript — CommCareHQ 1.0 documentation

Our web apps engine uses the same underlying JavaRosa / CommCare engine that powers our mobile apps running on a Spring Boot backend as part of our cloud infrastructure.

Unlike Enketo, this means that the rendering and form management requires a backend and a frontend, but it also lets us take advantage of the longitudinal database management from CommCare to manage Case data inside of forms.