======= Steps to Fill in the OrgStructure Table (Complete Guide) ====== This table is essential in mapping survey responses to the correct organizational unit, maintaining organizational hierarchy, and controlling data flow across modules. ✅**Note:** The **osname** and **oscode** should always be **identical** to the graph option**Bold Text** name to avoid discrepancies. For a complete description of the table structure and field explanations, please refer to the → [[fw_orgstructure|OrgStructure 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. Link the Master Organizational Structure (masterosid) ==== The **masterosid** acts as a foreign key, linking the current organizational unit to its master structure defined in the **orgstructuremaster** table. **Example:** If you have a **Cluster Midden** in the master structure, its **masterosid** will point to the corresponding master entry. **Example:** masterosid = 1 → Refers to "Cluster Midden" in orgstructuremaster. ==== 3. Enter the Organizational Structure Name (osname) ==== The **osname** represents the full name of the organizational unit. - This name should exactly match the graph option name to maintain consistency. - It is displayed in survey reports and dashboards. **Example:** osname = "Cluster Midden" osname = "Stilleweer (in Appingedam)" ==== 4. Enter the Organization Code (oscode) ==== The **oscode** serves as an internal code representing the organizational structure. - It is often the same as **osname** but can be customized. - This code is crucial in database queries and report filters. **Example:** oscode = "Cluster Midden" oscode = "Stilleweer (in Appingedam)" ==== 5. Define the Parent Organizational Structure (parentosid) ==== This column defines the **parent-child relationship** within the organizational hierarchy. - If the organizational unit is **top-level**, set **parentosid = 0**. - If the unit is under another structure, enter the **id** of the parent. **Example:** - For **Cluster Midden** → parentosid = 0 - For **Stilleweer (in Appingedam)** → parentosid = 1 (refers to Cluster Midden) ==== 6. Assign the Branch (branchid) ==== This column identifies the branch associated with the organizational unit. - It usually links to the **branches** table. - You can use comma-separated branch IDs if multiple branches are associated. **Example:** branchid = 1 → Linked to Branch ID 1 \\ branchid = 1,2 → Linked to Branch ID 1 and 2 ==== 7. Assign Module IDs (moduleids) ==== This field captures the module(s) associated with the organizational unit. - The value should correspond to the module IDs from the **modulesettingoptions** table. - Separate multiple module IDs with commas. **Example:** - moduleids = 1 → Linked to Module ID 1 - moduleids = 1,2 → Linked to Module ID 1 and 2 ==== 8. Set the Organizational Order (osorder) ==== The **osorder** column defines the order in which organizational units appear. Lower numbers appear first, higher numbers appear later. This affects the display order in reports and dashboards. **Example:** - osorder = 1 → Appears first - osorder = 5 → Appears fifth ==== 9. Set the Status (status) ==== This column controls whether the organizational unit is **active** or **inactive**. - Active units appear in survey selection and reports. - Inactive units are hidden but preserved in the database. ^ **Value** ^ **Status** ^ | **1** | Active | | **0** | Inactive | ==== 10. Track the Creator (createdby) ==== This column captures the **user ID** of the person who created the organizational unit. - It is automatically populated by the system. - Do not modify this value manually. ==== 11. Record the Creation Date (createdon) ==== This field stores the **timestamp** when the record was created. - It is automatically generated. - Avoid modifying this field unless required. ==== 12. Track the Last Modifier (modifiedby) ==== This column captures the **user ID** of the person who last modified the record. - This field is automatically populated. - Avoid manual changes. ==== 13. Record the Last Modification Date (modifiedon) ==== This field captures the **timestamp** of the last modification. - It is automatically updated. - Avoid modifying this field manually. ==== ✅ Notes ==== - Always ensure that **osname** and **oscode** match the graph option name. - Maintain correct **parentosid** for hierarchical reporting. - Keep inactive units preserved to avoid data loss. ====Example: Organizational Structure Hierarchy ==== {{:screenshot_2025-03-11_at_18.00.14.png?800}} ==== ✅ Example: Final Record ==== Here’s an example of a complete record for a single organizational structure: | id | masterosid | osname | oscode | parentosid | branchid | moduleids | osorder | status | createdby | createdon | modifiedby | modifiedon | | 2 | 1 | Cluster Midden | Cluster Midden | 0 | 1 | 1 | 1 | 1 | 996 | 2022-05-26 07:28:02 | 0 | 0000-00-00 00:00:00 | | 3 | 1 | Cluster West | Cluster West | 0 | 1 | 1 | 3 | 1 | 996 | 2022-05-26 07:28:14 | 0 | 0000-00-00 00:00:00 | This guide ensures accurate data entry for organizational units, enabling precise reporting and hierarchical data structuring.