When filling out a Survery123 form using a browser, my calculations from Survey123 Connect do not go through. On my mobile device and the desktop app they work. Is this know issue? Is there something I can do to get this to work on the browser?
Hi there,
I'm also got trouble with this. My use case is to do with dates and grouping. For my dashboard I want to be able to aggregate (group by and/or filter by) survey results by week and by month. E.g. show all surveys submitted in the week commencing Mon 13th March. The date category in the dashboard doesn't allow this, so I need to manipulate the category field. I know it should be possible in data expressions in Dashboard but that hurts my brain. Instead I thought I'd hard code it into my survey as hidden questions.
Attached is the spreadsheet but when I publish as a web survey the fields "Date (Week Commencing)" and "Date (Month Commencing)" don't populate. Any ideas how to get my desired outcome? Even if it is a code snippet to use in Dashboard rather than hard code into the survey.
Hi Marc,
We were able to figure out our issue with the body of our email not populating in the web form while also pulling in variables from our survey form. This is the code we used in our Calculation field on a note question.
concat(‘<a href="mailto:’,${email},’?subject=Annexation Application Invoice&body=Good Afternoon ’, ${owner},’,%0D%0A%0D%0APlease see the attached annexation application invoice. This payment will cover all attorney, recording, and processing fees. Payment is due within 30 days. Please note that an unpaid balance greater than 90 days will inactivate this annexation application and will require a new application and payment to proceed.%0D%0A%0D%0AIf you have any questions or need any additional information, please do not hesitate to contact Elba Cendejas at (772) 466-1600 Ext. 3227 or email AR@fpua.com. %0D%0A%0D%0AThank you,%0D%0A%0D%0A”>Email</a>’)
Ok, thanks for getting back to me.
@MarcCavallaro did you figure this out?
This really shouldn't be so difficult, I must be missing something obvious. I am just trying to create an url based on a predefined string concatenated with values from one field (https://myportal.com/projects/project1234/project1234_All.pdf). It works fine in connect and in field app but get NaN on the web browser.
@JamesTedrick any ideas?
Very simple calculation:
Are there plans to add the area() function to the web form?
Edit: Just noticed the area() function seems to work when the webform is embedded in Experience Builder!
That worked!
Sorry about the slow reply - I just now got back to that project.
Thanks!
Must be the same issue I had :
Remove the property("deviceid") and use the deviceid field type instead.
I have this issue too. The calculations I am trying to run work in Connect, but not after being published and accessed in a browser.
I am publishing from Connect version 3.9.120.
My form is attached if that helps.
Dude, I cannot thank you enough. I looked at the quick ref guide and guess with all the text I've been staring at I didn't even see that. It works perfectly! Appreciate the quick response.
Also, for the image icon appearing under the text, the field type was set to text, removed it and went away!
Hi,
Alternatively you could use the concat() function :
concat(value1, value2, …)
Returns the concatenation of the string values.
concat(${question_one}, ' and ', ${question_two})
regarding the Likert issue, it may have something to do with this :
Several appearance types available in Survey123 Connect are instead available as separate question types in the Survey123 web designer. This includes Multiline Text, Dropdown, and Likert.
(Quick reference—Survey123 for ArcGIS | Documentation )
I am having the same issue as most above...with an additional minor one. I am getting the NaN in my web form calculation when adding to string fields. I am adding values from a selected field and a text field using formula
${eclid2} + "-" + ${eclid}. It works well in app and Connect but in browser I get NaN. Am I missing something?
Also, when using the likert appearance, I get a "image" icon below the text. I have seen this before and may be something to do with the xls form, but not sure. Any ideas?
Hi James,
Thank you so much, now it works fine using the username question type.
Strange that half of the survey used to work with the property('username') and kept stopping at the Calculate field... but finally it had nothing to do with calculation
The issue with your form is the use of property('username'), which has been deprecated in favor of the username question type.
Is there a place to see what is supported in the web browser for calculations?
James Tedrick, I have also a similar problem witrh calculate field not working in web form.
My calculation is a nested if based on four select_one questions (also nested in the form) :
if(selected(${identification}, 'oui'), ${espece}, if(selected(${carapace}, 'dermochelyidae_luth'), 'luth', if(selected(${carapace}, 'cheloniidae_olive'), 'olivatre', if(selected(${carapace}, 'cheloniidae_5'), 'grosse_tete', if(selected(${ecailles_prefrontales}, 'prefrontales_1'), 'verte', if(selected(${ecailles_prefrontales}, 'prefrontales_2'), 'imbriquee','indeterminee'))))))
It works fine in field app but does not in web form.
Published from Survey Connect 3.6.137 and tested with web form "as is" 3.6 or "as latest" 3.8.
Is this a known issue ?
Hi Annina,
An alternative to the calculation would be to use an Arcade function, either to calculate a value later to a field or to display in a pop-up - Geometry Functions | ArcGIS for Developers
I am. But I don't have to, if there's a different way to implement. The user doesn't even need to see this question (if that helps); it's mainly for the analysis. I just don't want to have the consumers of the data to have to keep calculating area.
Are you using the area() function? That is not yet supported in the web form.
James Tedrick, can you help? I've got the same problem; calculating acres from the geoshape (I've a longer form, but I tried creating a short, simple one to make sure there wasn't any issues from other questions):Here's the view in Survey123 Connect:
And in Chrome:
Did you get the time calculations to work in the browser? I'm trying that same decimal time calculation for duration and it's not working in the browser but works fine in Connect
Sent the form through to you.
Hi Albertus,
It sounds like you have a conversion issue. As mentioned above, NaN is an indication a conversion to integer/decimal is not present. It would be helpful if you could provide the calculation set (including inputs).
I am getting the same problem. Survey form is concatenating two fields into a single field (all text) but getting the NaN in the browser. S123 Connect and app do not give the same issue. Any recommendations on how to fix/work around?
Thanks,
Albert
Hey Guys,
I'm Having the same issue with certain fields not calculating in the web form of Survey 123. Everything is working fine when submitting a survey from my IOS Device. However on the web form the following fields are not calculating: 'PointsRxBurnManager', 'PointsCounty', 'Total_Points', and 'TieBreakerPoints.' I've attached my spreadsheet. If you see something that I'm doing wrong, please help!
Michael
Hi Ryan,
In the web form in particular, there is a distinct difference between a datetime object and a time object; the decimal-time() function is needed to translate the time value (which is stored as a string) to a numeric value suitable for calculations.
Thank James, so specific to time calculation these are not supported in the web form ?
Based on your comments I can see what you mean now if I add a note field (graphic below).
Looking at samples and doc... it states this should be accomplished with decimal-date-time()? However it does not work in the web when tested. . So this statement is not true?
Decimal date time—Survey123 for ArcGIS | ArcGIS
https://community.esri.com/groups/survey123/blog/2016/04/17/dates-and-time-in-survey123-for-arcgis
Time spent for lunch in minutes
int(${LunchEnd} - ${LunchStart}) div (1000*60)
int((decimal-date-time(${lunchends}) - decimal-date-time(${lunchstarts})) * 24*60)
Loading your form, the fields are blank until all the values contributing to the equation have been filled in - this is to be expected, given the equations you have. Are you needing the average to occur when an incomplete form entry occurs? If so, you can use coalesce() functions to provide an alternate value when a question is unanswered
coalesce(int(${q}), 0)
GDay Mate, I published this in connect v3.0.142. To see the problem in action, try this link https://arcg.is/5qbHW
In the web form, time is treated as a text object. This will be addressed in the next version of Survey123 by introducing the decimal-time() function to convert time to a fractional day (i.e., 6:00 am = 0.25). From there mathematical operations can be done.
I'm not seeing the errors you are describing. Just to check, what version of Survey123 was this form published with?
HiJames Tedrick, I too am having issues with the calculations on the webform not calculating answers from previous questions, whereas the same survey using the Survey123 app on my mobile device/computer does work as expected. It would be nice to understand the requirements, my error, or if there is an issue?
As noted the Survey123 apps show the calculation (in my case the difference between two time fields, when a lift is reopened). The fields on the web form do not update as expected. For client reasons, I want to be able to rely on web version rather than the app so this is a bit of an issue.
I have tried to use the number() function and did not change to the output. For example,
int(number(${StartTime}) - number(${StopTime})) div (1000*60)
It is as if the webform is not dynamic?
Thoughts, appreciated.
Web form:
I have the same problem, I am using Note fields to display an average of values. As String fields they show 'NaN' as Decimal fields they show blank:
Have attached my xlsx
James,
Is it ok if I email it to you? I will send you my main XLS file, plus the two external ones.
Steven
Can you share the XLS file? Given the NaN value for a score, one thing to check would be that value types are explicitly set in calculations, using the number() function.
Hi Phil,
I am currently experiencing a similar issue to what Taylor outlined above. When I complete a survey through the web browser, not all of my calculations occur like they do when completing the same survey using the Survey123 app on my mobile device/computer.
I am utilizing two external spreadsheets for my calculations and as you can see in the image below, my Risk Assessment score do NOT populate like it does on the mobile/desktop version of Survey123:
Web Version Mobile/Desktop
What I find interesting is that the Web Version is able to calculate some values though as you can see in the image below where the Risk Score for question 4 populates.
James Tedrick, Philip Wilson
#webapp survey123 #survey123web #survey123calculations #survey123
Hi Taylor,
Not all questions and calculations are supported in the web app that were created in Connect and supported in mobile app. Can you please provide an example of a calculation that is not working?
Alternatively, can you share your xlsx file with details of which questions and calculations are not working in the web app, so we can see if it is an issue or bug with web app, or they are not supposed to be supported at this stage.
Phil.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.