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!
Hi Matt,
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
Regards,
Phil.
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.
Hi Philip Wilson, has this issue been resolved or is the work around you mentioned the only way to accomplish constraints with pulldata()? Thank you for your time.
Andy
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.