====== Steps to Fill in the OrgStructureMaster Table (Complete Guide) ====== This guide provides a step-by-step approach to correctly fill the **OrgStructureMaster** table. This table stores information about the hierarchical organizational structure for a given client. It helps define different levels within an organization, and specifies whether a particular level is used for evaluation purposes. The table is critical for structuring survey data and mapping responses to the correct organizational units. For a complete description of the table structure and field explanations, please refer to the → [[fw_orgstructuremaster|OrgStructureMaster Table Structure]] ==== 1. Add the ID (id) ==== This is the **primary key** (auto-incremented) for the table.\\ **Do not manually enter** this value if inserting data directly via the database.\\ It is automatically generated. ==== 2. Enter the Client ID (clientid) ==== This column captures the **unique identifier of the client** to which the organizational structure belongs. - Ensure that the **client ID** exists in the [[fw_clients|Clients Table]]. - This field is essential to link the organization structure to the appropriate client. **Example:** clientid = 1 ==== 3. Define the Label (label) ==== The **label** represents the name or title of the organizational unit, This label will be visible in reports and organizational hierarchies. **Example:** label = "Cluster A" ==== 4. Set the Hierarchy ID (heirarchy) ==== The **heirarchy** column determines the parent-child relationship of the organizational structure. It references the **id** of the parent organization unit. - If the unit has no parent, set the value to **0** (for top-level units). - For child units, enter the **id** of the parent unit. **Example:** ^label ^ heirarchy ^ | Cluster A | 0 | | Location 1| 1 | In this example, **Location 1** is a child unit of **Cluster A**. ==== 5. Set the Hierarchy Level (heirarchylevel) ==== The **heirarchylevel** column defines the depth level of the organizational unit. - **1** → Top-level units (e.g., Cluster) - **2** → Second-level units (e.g., Location) - **3** → Lower-level units, if applicable **Example:** ^ label ^ heirarchylevel ^ | Cluster A | 1 | | Location 1| 2 | ==== 6. Define If Used for Evaluation (usedforevaluation) ==== This column determines if the organizational unit is **used for evaluation purposes** in survey reports. ^**Value** ^**Meaning** ^ | **0** | Not used for evaluation | | **1** | Used for evaluation | If you want responses to be mapped to a specific organizational unit for evaluation, set the value to **1**. **Example:** usedforevaluation = 1 ==== 7. Record the Creator (createdby) ==== The **createdby** column captures the **ID of the user** who initially created this record. - This is usually linked to the **User Table**. - Ensure a valid user ID is entered. **Example:** createdby = 996 ==== 8. Capture the Creation Date (createdon) ==== The **createdon** column records the timestamp of when the organizational unit was created. - Format: **YYYY-MM-DD HH:MM:SS** - This is usually generated automatically if using the platform. **Example:** createdon = 2022-05-26 07:27:17 ==== 9. Record the Last Modifier (modifiedby) ==== The **modifiedby** column captures the **ID of the user** who last modified this record. * If no modifications have been made, the value remains **null**. * Otherwise, enter the valid user ID of the modifier. **Example:** modifiedby = 996 ==== 10. Capture the Modification Date (modifiedon) ==== The **modifiedon** column records the timestamp of when the organizational unit was last modified. - Format: **YYYY-MM-DD HH:MM:SS** - If never modified, the value will remain as **0000-00-00 00:00:00**. **Example:** modifiedon = 2023-09-07 15:58:13 ==== ✅ Notes ==== Always ensure the **client ID** is correct to avoid mismatched data. Top-level units should have **heirarchy = 0** and **heirarchylevel = 1**. ==== Example: Final Record ==== Here’s an example of a complete record for an organizational structure: | id | clientid | label | heirarchy | heirarchylevel | usedforevaluation | createdby | createdon | modifiedby | modifiedon | | 1 | 1 | Cluster | 0 | 1 | 0 | 996 | 2022-05-26 07:27:17 | 0 | 0000-00-00 00:00:00| | 2 | 1 | Location | 1 | 2 | 0 | 996 | 2022-05-26 07:27:24 | 0 | 0000-00-00 00:00:00| This structure would represent a client with one cluster and one location under it.