I have a 'Participant ID' field that references a csv list of unique codes that will be sent to individuals to complete the survey. I entered my pulldata formula in the Constraint field for the Part_ID field, and it works flawlessly in Survey123 Connect. But when I publish to webform (which is how the survey will be accessed), values that match the ID's still return a constraint error.
I've attached the Survey, the ID.csv, and a screen grab of the webform error. Thanks for any help!
Just letting you know I am looking into this issue and will need to gather some more information and will get back to you.
It appears that the web app does not support pulldata() being used in the constraint column, whereas the field app does. However, both the field app and web app support pulldata() being used in the calculation column. Therefore as a workaround if you create a new hidden or calculate field in your survey before the Part_ID question, use the pulldata() expression you wrote and move it into the calculation column on the new hidden question, and then point the constraint field of Part_ID to reference that new field, instead of directly using pulldata() it will work as expected.
More info can be found here on pulldata(): Formulas—Survey123 for ArcGIS | ArcGIS
And here regarding xlsform supported spec: Home
Thanks, Phil! This solution seems to have worked. However, in the webform, the constraint message always shows, at start-up, during typing of an incorrect ID, and even with a valid ID entered. I tried to add a string-length(.)!=0 constraint to the Part_ID field, but that didn't solve the issue. Any thoughts?
Can you send me a copy of your updated xlsx form so I can take a closer look, however I believe this is a known issue. Constraint messages are currently always displayed in the web app regardless of if a value exists. When the constraint is not true the field will be highlighted in red and must be valid before submitting. Therefore by the message being displayed it does not stop you from submitting.
We are currently looking into this behaviour and will get back to you with an update. In the meantime you can try to re-publish your survey with a more meaningful constraint message so that when it is displayed all the time it makes sense to the end user.
Thanks for the help, Phil. I've attached my updated Survey.
I changed the constraint message to something a little less harsh, saying to "Enter Valid Participant ID" rather than saying "Participant ID Invalid", that way the user doesn't get frustrated that their valid ID still says "Invalid ID", even though the entry isn't highlighted red any more.
I have reached out to our web developer team to follow up on the status of this issue, however I believe it has not been resolved and pulldata() will not work in the constraint column. Therefore the best solution is to use the workaround mentioned above.
Will keep you update with any progress.
Thank you for your reply Philip Wilson. I attempted to use the work around, however, I was unable to make it work. In fact, it spurred an error: Error: Unable to auto-detect delimiting character; defaulted to ',' - Which seems related to null values. Even after I deleted a null row, I still get the error and the pulldata() does not work correctly. I must be doing something incorrectly. Any chance you might take a look?
The pulldata() csv function will not work on the web app. I encourage you to submit this issue as a bug via Esri Support. Our Support team will assign an official bug number for your records. This number can be used to search for and subscribe to the bug on the Esri Support site. If the issue is reported by other customers it will be attached to the same bug report, which helps us assess the impact of the issue and prioritize it accordingly.
Jody Zheng Liu