Survey123 How to change default publish location?

4054
10
Jump to solution
03-28-2018 12:10 PM
MatthewDriscoll
MVP Regular Contributor

Using Survey123 Connect for ArcGIS. I have a survey which I originally published in the default location because I did not see any option to choose which folder to publish in.  I moved it to the correct group/folder for my organization so now when I re-publish it ends up in a never ending loop.  If I move it back to my home folder I am able to re-publish.   How do I tell Survey123 which folder I want to publish/re-publish to so I do not have to keep moving it? 

1 Solution

Accepted Solutions
JohnathanHasthorpe
Esri Regular Contributor

Hi Mathew

Survey123 will create a directory when publishing the survey and will give it the name Survey-<surveyName>. It will then create and place the form and and service items inside of it.

It is recommended that this folder structure is maintained - i.e. you should not move the form/service into other directories if you want to guarantee that things will work as expected.

Thanks

John 

View solution in original post

0 Kudos
10 Replies
JohnathanHasthorpe
Esri Regular Contributor

Hi Mathew

Survey123 will create a directory when publishing the survey and will give it the name Survey-<surveyName>. It will then create and place the form and and service items inside of it.

It is recommended that this folder structure is maintained - i.e. you should not move the form/service into other directories if you want to guarantee that things will work as expected.

Thanks

John 

0 Kudos
Cristian_AndresGalindo_Londoño
Occasional Contributor III

Hello Johnathan, 

I have clone surveys from a portal to another, in that operation I have changed the folder of the survey, and it still works.

When I perform that operation I clone the form and the feature service and the layers.

But this is when I clone it.

As Matthew point, how to organize the content either AGOL or Portal if the surveys cannot be moved?

JohnathanHasthorpe
Esri Regular Contributor

Hi Cristian

In my comment above I was referring to the process of publishing a survey in Connect, then moving the form/service to another directory and then trying to republish the survey from Connect. This is not recommended.

In terms of cloning surveys things may be a little different. Can you share the process that you are using to clone the surveys and move them to another portal? Are you republishing the services too, or are the forms pointing to an existing service?

Thanks

John

0 Kudos
VanessaSimps
Occasional Contributor

Does anyone know if I will lose data that staff has collected in the field if I change the folder as suggested? I am thinking that the draft data only lives on the phone, but I really do t want to lose that information! Here is why I ask:

I made the mistake of moving the items to another folder w/o realizing the consequences. Staff started collecting data last week and have several surveys saved in draft on the or phones. If I change the ownerFolder ID to the correct folder in AGO, will staff then be able to send the surveys w/o issue?  I am also looking at how to recover the draft surveys from the devices and then doing an fresh start with a new copy of the survey published where it’s default saved to.

0 Kudos
JohnathanHasthorpe
Esri Regular Contributor

Please see the following idea relating to this: https://community.esri.com/ideas/14814 

0 Kudos
ChadChurchill
New Contributor II

I have found that by modifying the survey ".itemInfo" file to reference a different "ownerFolder" id, a survey form can be moved out of the auto-created "Survey-<surveyName>” folder and placed into the folder of your choice, all while still allowing for updates to be successfully republished.

Process:

Open Survey123 Connect for ArcGIS, choose the survey you wish to update, click the ‘Open Survey Content File’, this will open your file browser to: C:\Users\<username>\ArcGIS\My Survey Designs\<surveyname>

 

Open the <surveyname>.itemInfo file with a text editor and look for the line that begins with “ownerFolder”, (this is line 34 in notepad++) the value that follows will need to be updated with the id of the folder you wish to move the survey form to.

The line should look like the following:

"ownerFolder": "zzz6e9697722414884a649b63e84408z",

Next, open ArcGIS Pro (assuming version. 2.1.2), open the python window and enter the following code to generate a list of folder names and id’s, given AGOL credentials.

import arcgis
gisTEMP = arcgis.GIS("<AGOL_URL>", "<username>", "<password>")
gisUser = arcgis.gis.User(gisTEMP, "<username>")
for fld in gisUser.folders:
    print(fld['id'], fld['title'])‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

*make sure to replace the <values> with your values

 

Copy the id of the folder you wish to move the survey form to, and paste it into the .itemInfo file, replacing the original ‘id’. Save the .itemInfo file. (You may wish to make a copy of the .itemInfo file first)

In AGOL you can now move the survey form to the new folder. (the one which matches the id used to update the .itemInfo file)

Since the .itemInfo file has been updated, when the survey is republished (using Survey123 Connect) it will reference the new folder location.

HuongTran1
New Contributor III

You can also get the folder ID from Pro open catalog, portal tab and hover over the folder

MatthijsAlberts
New Contributor II

You can also select the folder from AGOL in your browser and copy and paste the ID from the url.

kkatashuk
New Contributor II

The "iteminfo" folder trick works perfectly.

There is an easy button to find the Folder ID where you want your Survey data to go to so you don't have to write a script. 

If you open up ArcGIS Pro and login to your Portal/AGOL account on there, you can go to your "Portal" tab and go to "Content" and see all of your folders. Once you see the folder you wish to move your data to, simply hover over the folder. When you hover over the folder, it will bring up a URL. The last part of that URL is the folder you need. Click on the URL and you can copy that folder ID and then paste it into your Survey iteminfo file.

0 Kudos