Is there a calculation that will return the index or position of the current repeat set? This would be useful to pulldata and populate the default answers for each of the repeat questions based on the position in the repeat index.
Thanks for the enhancement request. There ar a couple of different ways this has been proposed before -
1) having an auto-incrementing number in the repeat
2) The XLSForm spec has a function called position() that might accomplish what you're describing
I've added this post to the enhancement issues of these two features.
Just FYI it does note that the position() function does not work....Open Data Kit » Binding , which I believe implies that the function must be called on some XPath expression? Such as '..', ie position(..)
"Return the XML position() value of this node in a filtered XPath expression. Note that position() does NOT work."
At them moment I am still trying to find a workaround, and will post if anything pans out. Please let me know if you have any other suggestions.
Have you heard of any success using the position() function in an XLSform w/survey123 ?
James I do appreciate your assistance through this, however I do still have some unanswered questions that may determine if I am able to use Survey123 at this time:
Is there any known method to reference the index of the repeat group/ repeat group counter at this time? It seems that none of the position(..) operators that I called were able to execute in Survey123 even though my work in other ODK collect/XLSform converters.
"ReferenceError: position is not defined in expression: position(..)"
The end goal I am trying to accomplish would be to dynamically reference external data within a repeat group of a varying number of iterations. Such that the form could be pre-populated with existing data.
Currently, the position() function has not yet been implemented - that's why I logged it to an enhancement request, for support of this functionality.
Understood thanks for clearing up the confusion on my end.
How about join() and/or a indexed-repeat() functions to access data inside the repeat group.... It seems to me that these functions are not yet supported in Survey123.
Is there a formal way to propose an enhancement?
Thanks in advance,
Both join and indexed-repeat are in the list of functions we plan to implement for XLSForm compatibility. Aside from requesting it here, we use the ideas.arcgis.com section of GeoNet to track user requests; enhancement requests can also arise out of technical support incidents.
Retrieving data ...