--- title: "Get Number Of Sub Contexts" slug: "get-number-of-sub-contexts" tags: ["sub contexts", "Debug", "Flows"] updated: 2023-01-19T16:31:03Z published: 2023-01-19T16:31:03Z canonical: "documentation.decisions.com/get-number-of-sub-contexts" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Get Number Of Sub Contexts | ## Step Details | | --- | | **Introduced in Version** | 4.0.0 | | **Last Modified in Version** | 5.12.0 | | **Location** | System > Advanced > Debugger | The Get Number Of Sub Contexts step will return the number of the specified sub context type. --- ## Properties #### Inputs | Property | Description | Data Type | | --- | --- | --- | | Debug Id | The Id of the debugged Flow | String | | Only Children | Determines whether only child elements are returned | Boolean | | Sub Context Type | Allows the user to specify the sub context type to be returned (All, Flows, Rules, Forms) | --- | #### Outputs | Property | Description | Data Type | | --- | --- | --- | | Output | The number of sub contexts within the debugged Flow | String | --- ## Example Inputs and Outputs | Debug Id | Only Children | Sub Context Type | Output | | --- | --- | --- | --- | | 6892a6da85c343148757ba98156a6e34_debug.5a2b35e7-afc3-45df-9b65-211a435d2e8d | False | Flows | 0 | | 1160d151c0854eadb54ca79a76eab017_debug.ff4150cf-63c8-4e12-b3ff-cd047f33988a | True | Forms | 1 | | Null | True | All | EXCEPTION MESSAGE | | 1160d151c0854eadb54ca79a76eab017_debug.ff4150cf-63c8-4e12-b3ff-cd047f33988a | False | Null | EXCEPTION MESSAGE | #### ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1674145398588.png) --- ## Common Errors ### Debug entity with id = '' not found If the debug id is null or empty, the step will cause an error. To correct this, ensure that the Debug Id is entered or mapped correctly. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get Number Of Sub Contexts 1[GetNumberOfSubContexts] in flow [Flow 6]: Exception invoking method GetNumberOfSubContexts on class DebuggerSteps ---> DecisionsFramework.LoggedException: Exception invoking method GetNumberOfSubContexts on class DebuggerSteps ---> System.InvalidOperationException: Debug entity with id = '' not found. at DecisionsFramework.Design.Flow.Service.Debugging.DebugData.DebugDataStorage.Retrieve(String id, Boolean failIfNotFound at DecisionsFramework.Design.Flow.Service.Debugging.DebugData.DebuggerSteps.GetNumberOfSubContexts(String debugId, DebuggerStepContextType subContextType, Boolean onlyChildren) --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` ### Parameter 'subContextType' of 'GetNumberOfSubContexts' can not be null If the Sub Context Type value is null or empty, the step will cause an error. To correct this, ensure that the Sub Context type is specified using a Constant mapping and selecting one of the options. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.BusinessRuleException: [BusinessRule] Parameter 'subContextType' of 'GetNumberOfSubContexts' can not be null at DecisionsFramework.Design.Flow.CoreSteps.InvokeMethodUtility.ThrowErrorIfNullIsNotAllowed(MethodInfo methodInfo, Object[] parameterValues, String errorMessage at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) ``` ## Related - [Get Start and End Time Steps](/get-start-and-end-time-steps.md) - [Get Number of Exceptions](/get-number-of-exceptions.md) - [Get Number Of Steps](/get-number-of-steps.md) - [Get Outbound Path](/get-outbound-path.md) - [Ended In Exception](/ended-in-exception.md)