AnsweredAssumed Answered

Can I update a Web App's Geoprocessing Widget Parameters?

Question asked by Michael.Brown3_CH2MHILL on Mar 10, 2017

I am curious if it is possible to update a widget parameter/config for a Web App with the ArcGIS API for Python?  I am able to successfully access and view the web app item's data, but I am unclear as to how I update the Web App item data.

 

I am downloading the JSON, modifying the widget parameter, and trying to update the item with the modified JSON (code below), but I get the error: ValueError: stat: path too long for Windows

 

item_data = webApp_item.get_data(try_json=True)
dataDumps = json.dumps(item_data)
webapp_json_as_dict = json.loads(dataDumps)

widgets= webapp_json_as_dict['widgetPool']['widgets']
for widget in widgets:
    if widget['name'] == 'Geoprocessing':
        for param in widget['config']['inputParams']:
            if param['name'] == 'Project_ID':
                test = ['ID_420751', 'ID_664616', 'ID_664616', 'TEST','TEST2']
                param['choiceList'] = test

jsonUpdate = json.dumps(webapp_json_as_dict)
webApp_item.update(data=jsonUpdate)

 

Any help would be greatly appreciated!

Outcomes