Cloning a survey 123 form in AGOL

129
1
4 weeks ago
Labels (1)
RichardHowe
Occasional Contributor III

I have sucessfully developed a suite of tools to enable colleagues to create duplicates from templated webmaps and counterpart feature layers using the clone_items() command with the source and target  portal being the same.

I have now moved on to attempting the same thing with survey 123 forms. What I have discovered is it works fine, but just once! The second time I try and run it, it fails with an error message stating a zip file with the same name as the survey 123 form already exists!

I can only assume the creation of this zip is part of what the clone process needs to do behind the scenes (just for Survery 123), but the issue is that once the clone has completed, the zip file evidently doesn't get deleted. Worse still I cannot see or find this zip file in my content anywhere (via the AGOL GUI or a list of portal items via python) to be able to manually delete it.

Any help in finding where it is hidden so I can clean up after the clone would be much appreciated.

0 Kudos
1 Reply
RichardHowe
Occasional Contributor III

Replying to myself here with some discoveries:

Having examined the json of Survey 123 forms, it seems that they are all in fact .zip files and the "Name" property is the issue.

So, unlike other items in AGOL, Survey 123 will not allow two items with the same name (but different item IDs) to exist at the same folder level. The workaround is to add a target folder (folder='new name') parameter to the clone and it works as expected.

This then limits you to always having cloned survey 123 forms in separate folders, as any attempt to move them into the same folder afterwards throws an "item already exists" error.

I have not yet found a way in python to rename a survey form (I don't know why that would be a restriction" but changing the .name property or editing the json directly to change that property seemingly works, but then instantly reverts to the original name).

It would be nice is ESRI provided a way to change the name of a survey 123 form pythonically

0 Kudos