Is it possible to manually or progamatically create a quickcapture project?

1028
5
Jump to solution
06-13-2021 04:06 PM
MarkC1
by
Occasional Contributor

Is it possible to create a quickcapture json manually and upload it to arcgis? I want to reuse the same project but with different basemaps. I'd like to be able to automate this so I don't have to go into quickcapture designer.

The use case is that I only want field workers to see features on the basemap that are relevant to their current assignment so for every assignment I need to create a new quickcapture project with a different basemap.

1 Solution

Accepted Solutions
Mandy_Li
Esri Contributor

Essentially, a 'QuickCapture Project' is an ArcGIS item type, and the project is defined with JSON. So theoretically, you can create a QuickCapture project, and update the item with the pre-defined project JSON using ArcGIS REST API.

To create a QuickCapture item, use addItem (type: QuickCapture Project, typekeywords: QuickCapture). Then you can update item resource with the predefined project JSON (the JSON body goes in the 'text' parameter, fileName: qc.project.json). You can directly copy the old project JSON from the </> JSON Editor in Designer, and refine the 'basemap' part to use another designated map. The project basemap JSON spec is here. For images on buttons, you will need to addResources to the new QuickCapture item. 

View solution in original post

5 Replies
Mandy_Li
Esri Contributor

Hi Mark,

In QuickCapture Designer, you can quickly make a copy of an existing project using 'Save as'. Once you have the copied project, you can continue to update it to meet your needs, which in your case, is to rename the title, change to another basemap, and save the project.

'Save as' is a very handy tool if you want to make a similar project to an existing one, but don't want to start configuration from scratch. 

XiaoxuLi_0-1623696848134.png

Let me know if this 'Save as' idea works for you. Otherwise, theoretically it is also possible to automate project creation and update process with REST API, although I did not test it out before. 

 

0 Kudos
MarkC1
by
Occasional Contributor

Hi @XiaoxuLi, yes I'm very familiar with this method which is great for occasional use but not ideal for what I want to achieve. I want to automated creation of work orders in Workforce and automatically create a corresponding project in QuickCapture with the appropriate map. How could I do this through the REST API? That would work fine but I'm not sure how I can edit quickcapture projects this way?

0 Kudos
Mandy_Li
Esri Contributor

Essentially, a 'QuickCapture Project' is an ArcGIS item type, and the project is defined with JSON. So theoretically, you can create a QuickCapture project, and update the item with the pre-defined project JSON using ArcGIS REST API.

To create a QuickCapture item, use addItem (type: QuickCapture Project, typekeywords: QuickCapture). Then you can update item resource with the predefined project JSON (the JSON body goes in the 'text' parameter, fileName: qc.project.json). You can directly copy the old project JSON from the </> JSON Editor in Designer, and refine the 'basemap' part to use another designated map. The project basemap JSON spec is here. For images on buttons, you will need to addResources to the new QuickCapture item. 

MarkC1
by
Occasional Contributor

Thanks @Mandy_Li, that's very helpful!

0 Kudos
EricaCirigliano
New Contributor III

Thanks, @MarkC1, for this post!

I wanted to use Python in an ArcGIS Pro Jupyter Notebook to update the basemap of an existing QuickCapture app. I've updated JSON in Items like web maps using the Item get_data() method, but that obviously didn't work for QuickCapture projects.

My code below may help someone accomplish the REST example above with Python - it will at least expose the basemap JSON.

app_to_update = gis_conn.content.get(app_id)
app_resource_mgr = app_to_update.resources #resource manager
app_resource_list = app_resource_mgr.list()
first_resource_filenm = app_resource_list[0]['resource']
if(first_resource_filenm == "qc.project.json"): #double checking that this is still the first item in the list
     app_proj_json = app_resource_mgr.get(first_resource_filenm,try_json=True)
     print(app_proj_json)