Survey123 Feature Layer has data in AGOL, appears empty from Python

273
2
11-17-2022 01:36 PM
gmcgwn
by
New Contributor II

We have an annual user application developed via Survey123 Connect for our organization. For the version deployed for calendar year 2022, I had Python scripts using the arcgis module that would pull down responses and attachments route them into our other workflows. 

I recently deployed the calendar year 2023 version. I can see entries when viewing the feature layer in AGOL, but accessing it via Python it appears empty when using an identity query to access all entries and convert to a Pandas dataframe. I can lookup the item and get the field names, but there appears to be no data.

I get the sense from many troubleshooting searches that it could have to do with the sharing and editing configuration. Here is the editing configuration for the feature layer:

gmcgwn_0-1668720851517.png

In the published survey itself, I have set members of my staff group as viewers, with viewers able to see and export all records.

0 Kudos
2 Replies
ZacharySutherby
Esri Regular Contributor

Hello @gmcgwn

What you are seeing is likely due to query being disabled on the feature service. If you switch "What features can editors see?" to "Editors can see all features" that should enable query on the feature service. Do you still see the same behavior? 

Would you also be able to pass along a few lines of code you are using to obtain the data in a Pandas Dataframe when I test on my end with a survey using the same settings I am able to see the data on my end: 

ZacharySutherby_0-1668721803546.png

 

Thank you,
Zach
gmcgwn
by
New Contributor II

Hi @ZacharySutherby,

Thanks for the help. It ended up being an issue with the OAuth2 application credentials I was using. I am not clear why, but switching from an access token obtained using application credentials to the interactive authentication scheme worked. Using only the application credentials/token had begun using arcgis.com rather than my organization, which seems to be why no data were appearing. Trying to use the SurveyManager as in your snippet was showing no surveys, which was the first clue.

Thanks again, your code snippet at least got me going in the direction I needed to go.

0 Kudos