A ui:call to a select template allows you to set a variable name for an index. See http://uispin.org/ui.html#forEach: <http://uispin.org/ui.html#forEach:>
As an optional argument of ui:forEach, the name of an index variable can be provided using ui:indexVar. The value of this variable will be the iteration counter, starting with 0. There is also a “tops:for” function you could possibly use: tops:for This property can be used to implement loops over a range of integer values. Syntax: ?index tops:for ( [startIndex] [endIndex] ) Description: The function iterates over all xsd:integer values >= startIndex and <= endIndex and assigns all those values to the variable on the left side Example: In the following query, the variable index will be bound to the xsd:integer values 2, 3, and 4. ?index tops:for (2 4) See the TBC Help File - section at http://127.0.0.1:65443/help/topic/org.topbraidcomposer.core/html/SPARQL_Property_Functions.htm?cp=2_14_4 <http://127.0.0.1:65443/help/topic/org.topbraidcomposer.core/html/SPARQL_Property_Functions.htm?cp=2_14_4> > On Jul 22, 2016, at 10:37 AM, pamar...@gmail.com wrote: > > Hello, > > I'm trying to increment a counter inside a forEach loop in a JSONService > created using SWP. > > I used <ui:group let:someCount="{= ?someCount + 1 }" >. Then completed my > other tasks, then closed the ui:group. > > When I check the value of ?someCount, it never changes. > > How can I increment a counter inside a forEach loop? > > -Paula > Sent from my iPhone > > -- > You received this message because you are subscribed to the Google Group > "TopBraid Suite Users", the topics of which include the TopBraid Suite family > of products and its base technologies such as SPARQLMotion, SPARQL Web Pages > and SPIN. > To post to this group, send email to topbraid-users@googlegroups.com > --- > You received this message because you are subscribed to the Google Groups > "TopBraid Suite Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to topbraid-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN. To post to this group, send email to topbraid-users@googlegroups.com --- You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.