The closest solution I've found to what I'm trying to achieve requires a separate JavaScript function (Solved: Stop Survey123 Entry if Duplicate Project ID Enter... - Esri Community). I'm hoping to find a solution with a few questions in the XLS Form.
I have a Survey where I don't want duplicate submissions for the same asset. The values in the field "InstallMeterNumber" should be unique. When a user enters a Meter Number, I'd like to check if that value exists in the field in the feature layer.
My survey has an existing text question to enter the meter number (InstallMeterNumber). I thought I could add an additional question with a calculation using pulldata to query the field in the feature layer and return some value that I could use as a constraint.
Something like:
- text question InstallMeterNumber
- note question InstallMeterNumberCheck with calculation pulldata("@layer", "getValue", "layer URL", "InstallMeterNumber = '${InstallMeterNumber}'")
- Then a constraint on one of the questions if InstallMeterNumberCheck is true or determine the count of the value and a constraint if InstallMeterNumberCheck != 0, or something.
Let me know if there's a solution I didn't find by searching. I haven't had luck going through the pulldata documentation to figure out how to determine if a value exists, what value would be returned by that query, and how to incorporate the appropriate questions in my survey.