# system.kanoa.cmms.addProcedureStep(procedureStepInfo, userId)

Adds a single step to an existing procedure identified by `procedureId`. 
Steps represent the individual actions a technician performs while executing a procedure (e.g. "Inspect belt tension", "Lubricate bearings"), and `sortOrder` determines the sequence in which steps are presented during procedure execution. 
The `required` flag marks whether the step must be completed (and, presumably, cannot be skipped) before the procedure can be considered finished, and `estimatedMinutes` supports scheduling/duration estimates for the overall procedure.
All procedureStepInfo keys are required.

stepConfig is a complex dictionary object containing additional step information stored in the database as a string.

---
### Parameters
**procedureStepInfo** `Dictionary`<br />
<table class='dictionaryKeyTable'>
	<tbody>
 	<tr><td> - enabled</td><td>Boolean</td><td></td></tr>	
 	<tr><td> - estimatedMinutes</td><td>Integer</td><td></td></tr>	
 	<tr><td> - procedureId</td><td>Integer</td><td>Id of procedure</td></tr>	
 	<tr><td> - required</td><td>Boolean</td><td></td></tr>	
 	<tr><td> - sortOrder</td><td>Integer</td><td></td></tr>	
 	<tr><td> - stepConfig</td><td>String</td>Can be None<td></td></tr>	
 	<tr><td> - stepDescription</td><td>String</td><td></td></tr>	
 	<tr><td> - stepName</td><td>String</td><td></td></tr>	
	</tbody>
</table>

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

---
### Returns
**procedureStepId** `Integer`<br />
**message** `String` None if success<br />

---
### Example
```python
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})

stepConfig = {
					'dataTypeId': '5', 
					'engUnitId': None, 
					'specInfo': {
									'specType': 'setPoint', 
									'setPoint': {'operator': '>', 'value': 10}, 
									'range': {'max': None, 'min': None}, 
									'regex': {'value': ''}, 
									'tolerance': {'tgt': None, 'lsl': None, 'usl': None, 'lel': None, 'lcl': None, 'ldl': None, 'udl': None, 'uel': None, 'ucl': None}
								}, 
								'pickListInfo': {
													'pickListId': 8, 
													'pickListValues': {
																		'Fraction': {'max': None, 'increment': None, 'min': None}, 
																		'Text': {'WARNING': [], 'PASS': [], 'FAIL': [], 'NEUTRAL': [], 'multiSelect': False}, 
																		'Time': None, 
																		'Number': {'max': None, 'increment': None, 'min': None}, 
																		'Tree': '', 
																		'Barcode Scanner': {'script': None}, 
																		'Boolean': {'TRUE': ['Yes'], 'FALSE': ['No']
																	}
												}
								}
				}

procedureStepInfo = {
                        "procedureId": 12,
                        "stepName": "Inspect belt tension",
                        "stepDescription": "Visually inspect the conveyor belt for proper tension and signs of wear.",
                        "stepConfig": system.util.jsonEncode(stepConfig),
                        "sortOrder": 1,
                        "estimatedMinutes": 5,
                        "required": True,
                        "enabled": True
                   }

procedureStepId, message = system.kanoa.cmms.addProcedureStep(procedureStepInfo, userId)
print procedureStepId, message
```
