# system.kanoa.dashboard.updateWidget(widgetInfo, userId)

Updates a widget.

---
### Parameters
**widgetInfo** `Dictionary`<br />
<table class='dictionaryKeyTable'>
	<tbody>
 	<tr><td> - categoryName</td><td>String</td><td>The category</td></tr>	
 	<tr><td> - enabled</td><td>bit</td><td></td></tr>	
 	<tr><td> - sortOrder</td><td>Integer</td><td>The sort order</td></tr>	
 	<tr><td> - viewParams</td><td>String</td><td>view parameters</td></tr>	
 	<tr><td> - viewPath</td><td>String</td><td>The path to the view</td></tr>	
 	<tr><td> - widgetDescription</td><td>String</td><td>The description of the widget</td></tr>	
 	<tr><td> - widgetId</td><td>Integer</td><td></td></tr>	
 	<tr><td> - widgetName</td><td>String</td><td>The name of the widget</td></tr>	
	</tbody>
</table>

**userId** `Integer`: Id of user executing the function<br />

---
### Returns
**# of records modified** `Integer`<br />
**message** `String` None if success<br />

---
### Example
```python
userId = 123
widgetInfo = {
  "widgetId": 36,
  "widgetName": "Asset Downtime Bar Chart",
  "widgetDescription": "Display Downtime By Asset",
  "enabled": True,
  "sortOrder": None,
  "viewParams": "{"assetPath": None, "downtimeBy": "Interval", "showDowntimeBySelector": True}",
  "viewPath": "kanoa/core/dbp/widgets/analytics/assetDowntimeBarChart",
  "widgetCategoryName": 'Analysis'
}
retVal, msg = system.kanoa.dashboard.updateWidget(widgetInfo, userId)
if msg:	system.perspective.sendMessage('showFailerToast', msg)
else: system.perspective.sendMessage('showSuccessfulToast', 'Widget parameter has been saved')
```
