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

588
0
03-10-2017 10:15 AM
MikeBrown4
New Contributor II

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!

0 Kudos
0 Replies