Hi Guys,
Hoping you can shed some light
I have a survey with a repeat, and the calculations don't seem to work automatically unless I have a default populated. In this case '0'
Problem is, that I can't put a default on the repeat? or can i?
Kind Regards,
Alex
Hi Wayne,
Yes the above repeat bug I mentioned was fixed in 3.2. The updated version is available in the app stores and Survey123 website to download now. We do still have one issue with nested repeats and data not displaying in first record of nested repeat with relevant expression referencing a question outside of the nested repeat when open from Drafts/Sent/Inbox, but this is different to above issues.
As for the web form, not all repeat and nested repeat, and xlsform advanced expressions that work in the app work in the webform. Can you share exactly what is not working and any error messages?
Phil.
Thanks for the response Phil.
I have a repeat that has a dropdown choice, then a pulldata that gets prices from a CSV. It also has a calculation based on these selections within the repeat. Outside of the repeat these are summed up and presented to the user. It's an estimate of equipment rental costs.
When you add a second item to the repeat in the web form, it will not calculate inside the repeat. (which I assume causes the calculations outside the repeat to fail, because it is dependent).
I've attached the form and pulldata CSV. I'm using the connect version 3.2.196.
Thanks for your willingness to help.
Wayne
Hi Wayne,
There are two things I found that could be the cause of the issues you are having. Firstly, the csv file has a blank row at the end of it, if you open in NotePad++ or similar advanced text editor, you will see this blank row, however if you open in Excel you will not see it. We have seen that these blank rows can cause issue with web app:
Secondly, the note EstUnitCost has two dollar signs $ in the label, one is for the question it is referencing, the other I guess is for you to show it on the form as a dollar amount, this could cause an issue as web app may not be processing this correctly.
Estimated Rental Cost for Selected: $${calcEstUnitCost}
Regards,
Phil.
Great catch on the extra line in the CSV, however that wasn't the issue. I removed the extra line and the additional $ symbol and the web form still doesn't work as expected. Oddly, if I add a second repeat the form doesn't calculate, but if I delete the first repeat and the formerly second repeat becomes the only repeat, the form calculates to the new values, as expected.
Should I be applying a default value (or removing it) or perhaps a test for 0 string length anywhere? I'm trying the if(string-lenght()>0,.....,0) trick next. Hoping if there is a 0 value, I can at least get it to show a value in the calculated fields.
It works great in the field app.
Thanks for your help!
Hi Wayne,
I had a further look and also used the updated survey with those issues fixed I mentioned yesterday, it appears this is a bug with the web app and will need to be fixed in a future release. I have logged an issue for it and updated with your comments and survey. Will keep you posted when we have a fix for it.
In the meantime, you may want to try and change the way you are trying to use the calculation in a label on a note question in the repeat, and move it to a integer/decimal field and actually store the value, and put the calculation in the calculations column. This should work and not affect the total, just means you have more stored values in the repeat, not just in a note.
Phil.
Thanks again Phil.
Using your suggestion to add the calculations as interger fields, it became clear that the repeated pulldata() function is not pulling the data which cascades down to the other calculations. That may be a place to start looking in your bug hunt. Thanks again, and I'll just remove these repeat calculations for now.
Wayne
We have a fix for the repeat_count issue on the EAC - please test out the latest release candidate builds here: https://earlyadopter.esri.com/project/home.html?cap=%7bE69EF91F-4574-4B98-882C-651F7B518EB7%7d