Table of Contents
Steps to Fill in the BranchQuestions Table (Complete Guide)
This guide provides a step-by-step approach to correctly fill the BranchQuestions table. This table is responsible for linking specific questionnaire details to branches, allowing you to customize which questions appear for each branch.
The table is critical for ensuring that different branches have specific questionnaire content, depending on their needs or operational scope.
👉 Branches Table Structure
👉 QuestionnaireDetails Table Structure
For a complete description of the table structure and field explanations, please refer to the → Branch Questions 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 Branch (branchid)
The branchid column establishes a connection between the branch and the questions assigned to it. This value must reference an existing record from the Branches Table.
How to find branchid? - Go to the Branches Table. - Locate the desired branch and note its id. - Use that id as the branchid here.
Example: branchid = 3 (The ID 3 refers to the “Zevenaar-Didam” branch)
3. Link the Questionnaire Detail (qdetailid)
The qdetailid connects the question to the branch. It references the QuestionnaireDetails Table, where individual questions are listed.
How to find qdetailid? - Go to the QuestionnaireDetails Table. - Locate the desired question and note its id. - Use that id as the qdetailid here.
Example: qdetailid = 12 (This ID refers to a specific question from the questionnaire)
4. Set the Status (status)
This column indicates whether the question is active or inactive for the branch.
Use the following values:
| Value | Status |
| ———– | —————– |
| 1 | Active |
| 0 | Inactive |
Example: status = 1 (The question is active for the branch)
5. Enter the Created By (createdby)
This column captures the user ID of the person who created this record.\
Where to find createdby? - This is typically the user ID in your system.
Example: createdby = 1089 (The user with ID 1089 created the record)
6. Enter the Created On (createdon)
The createdon field captures the timestamp when this record was created.\
Format: YYYY-MM-DD HH:MM:SS
Example: createdon = 2025-01-15 10:30:00 (The record was created on January 15, 2024, at 10:30 AM)
7. Enter the Modified By (modifiedby)
This column captures the user ID of the person who last modified the record.\
Where to find modifiedby? - This is typically the user ID in your system.
Example: modifiedby = 1089 (The user with ID 1089 last modified the record)
8. Enter the Modified On (modifiedon)
The modifiedon field captures the timestamp when this record was last modified.\
Format: YYYY-MM-DD HH:MM:SS
Example: modifiedon = 2025-02-01 14:00:00 (The record was last modified on February 1, 2024, at 2:00 PM)
9. Example: Final Record
Here’s an example of a complete record for a single branch-question link:
| id | branchid | qdetailid | status | createdby | createdon | modifiedby | modifiedon |
| 1 | 3 | 12 | 1 | 1089 | 2024-01-15 10:30:00 | 1089 | 2024-02-01 14:00:00 |
✅ Notes
- Always ensure that the branchid exists in the Branches Table.
- Always ensure that the qdetailid exists in the QuestionnaireDetails Table.
- Set status = 1 for active questions and status = 0 for inactive questions.
This table plays a critical role in ensuring that specific questions are assigned to their respective branches, enabling customized surveys for each branch.
