Posting this to see if anyone have any ideas as I am still a beginner with Python. The export survey data script Export survey data with attachments | ArcGIS Survey123 exports all of the attachments but within my Survey123 I'd like to just export a subset (in this case date ranges, my column name is SurveyDate) I tried to modify the query line but it seems like I am supposed to define "SurveyDate" parameter somewhere in the code. Not sure what I am doing wrong. Any ideas would be helpful Thanks.
Make sure your query is still in quotes. If the script is talking about a parameter named SurveyDate, my first assumption would be that you deleted the quotes.
Consider (fairly certain this is correct):
feature_object_ids = i.query(where="SurveyDate > '2024-09-10T12:12:00.000'", ...
vs (Incorrect):
feature_object_ids = i.query(where=SurveyDate > '2024-09-10T12:12:00.000' ...
DISCLAIMER 1: Dates generally refuse to stick in my brain when it comes to SQL, so the actual query above might be an issue. But placing the whole thing in quotes like that shouldn't be.
DISCLAIMER 2: There's also the fun mayhem of whether or not your field name also needs quotes or other delimiters around it; I can never keep straight which database types do and don't. I also have no idea which pattern Survey123 follows, either. I say try without any delimiters around the field name (but make sure that it is in a string!)
The important takeaways here that can burn you if you're not careful:
Thanks @MErikReedAugusta When I tried to modify the query as you suggested, I get 'Invalid Field: SurveyDate' parameter is invalid (Error code: 400). I am guessing this parameter needs to be defined somewhere in the code, I could be wrong
Can you try posting a copy of your modified code here?