Select to view content in your preferred language

How to count up an index when using repeat function in XLSForms

1382
2
Jump to solution
03-22-2021 08:38 AM
SnezanaEckl
Esri Contributor

 

Dear Esri Community,

Is it possible to display the index of the repeat function in a Survey. I only found sum or count function, but it provides only the total number of the answers. 

The goal is to create a survey with several answers and each answer should get the index of it, e.g. like this:

2021-03-22_16h19_11.png2021-03-22_16h19_18.png

This is done by count() function. But when you refresh the first entry, it gets, as expected, also the number 2, because it has two answers, but instead we want the ID T01 here:

2021-03-22_16h32_39.png

Please see also the attached form.

Thank you for your ideas!

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

There is a new one still in beta.  If you have at least 3.12 you can use position(..) or if you have multiple repeats position(${nameof repeat}).

If not 3.12 you make a field with a calc of 1 then go once(count(field))

Hope that helps

View solution in original post

2 Replies
DougBrowning
MVP Esteemed Contributor

There is a new one still in beta.  If you have at least 3.12 you can use position(..) or if you have multiple repeats position(${nameof repeat}).

If not 3.12 you make a field with a calc of 1 then go once(count(field))

Hope that helps

SnezanaEckl
Esri Contributor

Dear @DougBrowning , 

Thank you very much for your help! The position()-function works!

Unfortunately that function is not mentioned in the German documentation yet. But I found it now in the English documentation.

Best regards,

Snezana