Select to view content in your preferred language

Int Object is not Subscriptable when uploading template via API for Python

1130
5
Jump to solution
01-18-2023 11:46 AM
DannyDeimel
Emerging Contributor

I'm attempting to upload a template to a survey123 item. Even with following the steps from https://developers.arcgis.com/survey123/guide/create-reports-using-the-arcgis-api-for-python/#genera... I still get this error. Any help would be awesome.

int not subscriptable.PNG

0 Kudos
1 Solution

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @DannyDeimel

Are you the owner of the survey / is the folder the survey resides in within your content? 

Thank you,
Zach

View solution in original post

0 Kudos
5 Replies
ZacharySutherby
Esri Regular Contributor

Hello @DannyDeimel

Are you the owner of the survey / is the folder the survey resides in within your content? 

Thank you,
Zach
0 Kudos
DannyDeimel
Emerging Contributor

Sorry for the late response on this topic.

Yes, I am the owner of the survey and the survey resides in my content.

From my testing, it seems the issue is caused by my folder name leading with integers. When trying to upload to a folder that does not lead with integers, it works as expected. Though, I don't quite understand why that would be a problem.

Thanks,

0 Kudos
ZacharySutherby
Esri Regular Contributor

Hello @DannyDeimel

Would you be able to provide the name of the folder your survey resides in? It typically is Survey-<name of survey> if that is coming through as an integer that would be strange. Knowing the folder name that's causing the issue I can spin up a test survey on my end with the same name and dig deeper into the Python API code. 

Thank you,
Zach
0 Kudos
DannyDeimel
Emerging Contributor

Hi,

I am just now coming back to this issue since the original post and it seems your original comment was the answer. 

I have retested and do not have issues uploading the templates. When I was first testing the upload function with the python API, I must have been signed in with a different user than the one that owned the survey.

I will mark your original comment as the solution.

Thanks!

ZacharySutherby
Esri Regular Contributor

Hello @DannyDeimel

Awesome! I'm glad that worked out! 

Thank you,
Zach
0 Kudos