In a nutshell, I created a Survey123 for requesting a certain permit. If the resident requests a start date between X and Y, their permit will be for 21 days. If they request a start date between Y and Z, their permit will end on June 1 specifically. Since in some cases the End Date is calculated based on the Start Date while in other situations it's a set rule of June 1, the only way I know to set that up in Survey123 is to have 3 questions, as laid out below.
Question1: Start Date (user can input any date within a given date range, set as a constraint)
Question2: End Date (visible only if Start Date is within a given date sub-range, set as a constraint) = Start Date + 21
Question3: End Date May (visible only if Start Date is within a different given date sub-range, set as a constraint) = June 1
Because the overall end date of the permit is therefore sometimes in one field and sometimes in the other, I'd really like to know if:
OR
There will only ever be data in ONE of the two fields, not both, and never will they both be empty.
However, I can't find any documentation that mentions using IF or IsEmpty when defining a new variable.
Ultimately, I am setting symbology colors based on the permit's approval status plus the dates. (Approved & In Progress, Approved & Future, Approved & Expired, Denied, and Under Review) I can work around all of this by just listing out all combinations individually with || for OR to check both end date fields but as mentioned before, if staff go in and update the dates, I don't want them to feel confused as to which field to mess with.
Pic below of the resulting data after filling out some pretend survey submissions.
You could make both date questions null (don't submit any data) and then calculate one date question, hidden from the users? will work in survey123 and make things less confusing in ArcGIS online.
In the date calculation you can add an if statement to calculate the date, using the same logic you are using to show one of the two date questions.
This is in Survey123 Connect.
It will not work well if users are updating via survey (because null questions) but will if they update date in ArcGIS online
Thanks for the suggestion! While I've dabbled a little in Connect (still very much a beginner), this survey has so far been made and managed in the web browser, and my understanding is that if I start editing the structure of the questions in Connect, that I will no longer be able to edit in browser, so I hadn't taken that step yet but certainly can if it would get me to the final structure I'm hoping for!
I also want to make sure I understand what you are suggesting - do you mind elaborating on the third bullet point? If this was a spreadsheet or Arcade, for example, it sounds like it would be structured as an IF statement, where:
Can one do something like that in Connect?
if(condition, a, b)
But you'll need to nest them so it's
if(condition, return a, else run second if)
If(${question1}='x',${question2}, if(${question1}='y',${question3},''))
Yes you'll be stuck with Connect after republishing.
The issue with my suggestions is that if you are using survey123 to edit, you'll have a bad time. You'll need to consider how the null fields and calculations play out when the survey form is opened a second time. This method only works well if they are using survey123 to submit data and updating the date value directly within the table (not survey form).
Thanks, looking into which column this would belong in and whether I can use some form of is null or is empty as one of my conditions. Conceptually it makes sense but this is definitely beyond what I've done before in Survey123. I've made a copy of the survey so I can tinker with it without fear!