I found out what it was for me. You have to be using the owner of the form. I got that error when running it from ArcPro and wasn't logged in using the form owner.
Andrew- yes, this seems to be the case for me as well. Problem is, I want a user who doesn't own the form to have the ability to run a script that exports Survey123 results. Can anyone at ESRI advise on a workaround?
In the Survey123 website under the Collaborate tab > Share results, are the results of the survey shared with the user trying to run the script?
The method is trying to use the _results view to pass into the Survey123 report engine. Does the user running the script have access to the _results view?
To verify the user trying to run the script has the _results feature service view (or _stakeholder if the survey is older) shared with them? This will be different than the parent feature service the survey may be submitting to:
Is the same user able to export reports from the Data tab in the Survey123 website?
We do not have a results feature service view. Is that something that I need to enable somewhere? We've never had a need for such functionality- we simply have a feature service and a map service published off of a SDE feature class, and obviously use the feature service for report submissions. And yes, the user can export reports from the data tab in the Survey123 website, but no one can export records (since the feature service is non-hosted).