# system.kanoa.performanceState.checkPerformanceState(performanceStateName, performanceStateClassId, performanceStates, userId)

Checks if an performanceState exists for the performanceStateClassId and creates it if it doesn't

---
### Parameters
**performanceStateName** `String`: Name<br />
**performanceStateClassId** `Integer`: Class<br />
**performanceStates** `Dictionary`: Dictionary of performance states to check<br />
**userId** `Integer`: Id of user executing the function<br />

---
### Returns
**performanceStateId** `Integer`<br />
**performanceStates** `Dictionary` updated dictionary if new item state created<br />
**performanceStatesUpdated** `Boolean` True if performanceStateName was not found and added to performanceStates<br />
**msg** `String` None if success<br />

---
### Example
```python
userId = 5
performanceStateName = 'Speed Loss'
performanceStateClassId = 4
performanceStates = system.kanoa.utilities.convertDatasetToDict(system.kanoa.performanceState.getPerformanceStates({}), 'performanceStateName', 'performnceStateId')
performanceStateId, performanceStates, performanceStatesUpdated, msg = system.kanoa.performanceState.checkPerformanceState(performanceStateName, performanceStateClassId, performanceStates, userId)
```
