Select to view content in your preferred language

Repeat counts returning 1 as 10 or 100

817
6
Jump to solution
01-14-2026 08:21 PM
LindsayRaabe_FPCWA
MVP Regular Contributor

I'm build a survey in Survey123 Connect and it contains a number of repeats. I'm using the repeat_count parameter and count() to get how many repeats have been created in Repeat A and using that to generate prefilled repeats in Repeat B, but keep running into an issue. It seems that when adding counts together, instead of adding 1 + 1 to get 2, its returning 10. If I add a 3rd count on, instead of 1+1+1=3, it returns 100. What am I doing wrong?

In the screenshot below, I have 1 repeat each in 2 of the 3 repeat tables to be counted (Part_B_Part_C_Prevention_Risk_Controls_PRCs_System_Procedural_Controls and Part_B_Part_C_Prevention_Risk_Controls_PRCs_Plant_Equipment_Infrastructure_Controls) which is reflected correctly in label1 and label2 with "1" returned in each. But in label4, instead of showing "2", it shows "11". This is compounded in label5 with "110" being returned. It's like it's concatenating the values instead of adding them together. 

LindsayRaabe_FPCWA_0-1768450801242.png

This then results in 110 repeats being created in the destination table (instead of 2). I also don't seem to be getting the value passed across correctly (PRC to action) but thats a different issue and haven't dug into it yet. 

LindsayRaabe_FPCWA_2-1768450889057.png

Note - in the sample xls attached, I've set the fields to text to show in the form, but the intention is for them to be calculate fields and hidden. 

 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
2 Solutions

Accepted Solutions
LindsayRaabe_FPCWA
MVP Regular Contributor

Just the act of writing this up has helped me figure out whats happeneing. It's treating it as text isntead of a number and concatenating the values. I updated my formula to use the int() function around each field and it worked. 

Before: ${nPRC_sys} + ${nPRC_plnt}

After: int(${nPRC_sys}) + int(${nPRC_plnt})

 

Now, jsut to figure out why it isn't passing the indexed values across properly (it's probably related to the returning of the value as text instead of an integer as well). 

Lindsay Raabe
GIS Officer
Forest Products Commission WA

View solution in original post

0 Kudos
ZenMasterZeke
Frequent Contributor

@LindsayRaabe_FPCWA 

For calculate fields, text is the default return type. You can override this by setting the bind::esri:fieldType column to integer, or whatever other data type you feel appropriate. This should also allow you to get rid of the int() functions.

View solution in original post

6 Replies
LindsayRaabe_FPCWA
MVP Regular Contributor

Just the act of writing this up has helped me figure out whats happeneing. It's treating it as text isntead of a number and concatenating the values. I updated my formula to use the int() function around each field and it worked. 

Before: ${nPRC_sys} + ${nPRC_plnt}

After: int(${nPRC_sys}) + int(${nPRC_plnt})

 

Now, jsut to figure out why it isn't passing the indexed values across properly (it's probably related to the returning of the value as text instead of an integer as well). 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
ZenMasterZeke
Frequent Contributor

@LindsayRaabe_FPCWA 

For calculate fields, text is the default return type. You can override this by setting the bind::esri:fieldType column to integer, or whatever other data type you feel appropriate. This should also allow you to get rid of the int() functions.

LindsayRaabe_FPCWA
MVP Regular Contributor
OFFICIAL

I assume that doing that would force the calculate field to be created instead of being temp during form completion?
Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
ZenMasterZeke
Frequent Contributor

@LindsayRaabe_FPCWA 

Wouldn't the calculate field normally be created anyway? It's a hidden field on the form. You can set bind::esri:fieldType to null to prevent it from being added to the table.

LindsayRaabe_FPCWA
MVP Regular Contributor
OFFICIAL

There's my ignorance showing. The problem with learning as you go and not doing all the reading but just skimming to find what you need. Thank you.
Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
LindsayRaabe_FPCWA
MVP Regular Contributor

I marked 2 solutions as both are valid - 1 where the field is retained and the other where the field is used to calculate temp values but isn't saved to the feature service. 

Lindsay Raabe
GIS Officer
Forest Products Commission WA