auto_stories Knowledge Base chevron_right Form chevron_right Article

Organization Chartv5

The Organization Chart tool lets you visualise your organisation charts in Xpoda as a tree. 

 

Appearance in ToolboxAppearance in Free FormAppearance in Responsive Form
          

 

Compatibility

Free FormResponsive FormMobile
icons8-check-circle-48.pngicons8-check-circle-48.pngicons8-check-circle-48.png

 

Properties of the Organization Chart tool: 

 

Type (Field Type): Shows the field type of the added form tool. This value cannot be changed. 

Edit Form: The name of the field to be created in the database is written here. 

Parent: On the edit form, used to define the parent unit a record belongs to in the organisation chart. The value chosen here sets under which unit the record is placed in the chart. 

Name: On the edit form, the field showing the title or name of each item in the chart. The value chosen here is shown as the name in the item's box. (For example, the full name for employees, or the unit name for departments.) 

Title: On the edit form, sets the field for an extra description or detail of each item. The value chosen here is shown under the Name in the chart boxes. (For example, an employee's job title, e.g. “Sales Manager”)  

Avatar: On the edit form, chooses the field shown as an image for each item (for example a profile photo or icon). It appears at the top left of the chart boxes. Usually a user photo, department logo or representative icon is used, to enrich the chart and make items easier to tell apart. 

Expand: On the edit form, the field used to check whether an item has child units. The value chosen here sets whether the record can be expanded in the chart. If it is "true", the item is treated as having children and the user can expand it.
In Xpoda, for this field, a 'Switch element' can be used to let the user choose yes/no (true/false). This makes it easy to control the chart's dynamic structure. 

Help Text: Text shown as a description when the mouse is moved over the form tool. 

Height/Width:Sets the height and width of the form tool. 

From Left/ Top: Sets the distance of the tool from the left and top. 

Edit: Allows the records in an existing organisation chart to be edited. If set to "Yes", users can change the information of existing items in the chart on the Client side (for example name, position or manager). 

Create: "Yes" enables adding new records (new positions or people) to the organisation chart. 

Display: "Yes" shows the component on the client screen. 

Delete: "Yes" enables deleting existing records from the organisation chart. 

Organization Chart Example: 

Let's create an Organization Chart example together. 

In this example we prepare an organisation chart of a hospital's key staff. 

With this chart the hospital's staff structure is presented hierarchically and interactively. 

First we need an Edit Form from which the Organization Chart gets its data. Let's design an Edit Form screen for the item values shown on the chart. This form lets users enter the required information for each item in the chart. Configuring the Edit Form correctly is important for items to be shown correctly in the Organization Chart. 

 

Go to the page we will design in Studio. 

 

Select the form named Form_1; then, in the form's properties on the right, write 'HospitalOrganizationChart' in the Name field. Since we will save to the database, choose 'Form' as the form type.

 Write 'HospitalOrgChart' as the table name in the TableName field.

 

From the form tools on the left, drag 1 Drop Down Box, 2 Text Boxes, 1 Picture and 1 Switch onto the form. 

 Select the labels and fields one by one and name them in the Text property as in the image. Press Enter after each one.

 

On the edit form, for the Parent Unit drop-down, we need a special query so users can choose. In this query we first add an option representing top-level departments that are not under any department. This option is usually called “None” and its ID value is zero (0). 

 

The ID value (0) is mandatory. 

 

Then, by listing UserTableID and Position from the HospitalOrgChart table, we let users easily choose the department they belong to. If the unit has no parent department, the user picks “None”; otherwise they pick the department from the list. 

Parent Unit drop-down query: 

SELECT 0 AS id, 'None' AS DepartmentName 

UNION ALL 

SELECT UserTableID, Position FROM HospitalOrgChart WITH (NOLOCK) 

With this query, in the organisation chart, the user gets "None" (no parent) together with all existing positions (Position column) and their UserTableID values as a list. 

 

The Parent field in Organization Chart must be fed from the Title field, because each record added to the table creates a new id, and that id is used for the Parent field. That is why, in this example, the query of the 'Parent Unit' drop-down (matching Parent) selects 'Position' (matching Title) with its id from the table.

 

After the settings, save the project and click Run to switch to the client screen. 

 

blobid0.png, Resim

 

The client screen shows the last saved state of the project. If you switch without saving, the latest changes are not shown. 

blobid0.png, Resim

 

After the project is saved, since the screen's Type is 'Form', a new table named as in Table Name is created in the XPODA database with the field names and data types added to the screen. 

Enter a few sample records to show in the Organization Chart and save them with the save button at the bottom right. (If you do not want to use this button, drag a button from Studio and give it a save action.) Build the hierarchy by choosing each person's department (parent). 

Our first record has no parent, so it is shown at the top of the chart. 

Choose 'None' in the drop-down (meaning this person belongs to no department). Then enter the other information following the numbers and save with the green button at the bottom right.

Let's enter a few more sample records. 

‘HospitalOrgChart’ The records we added to the table are as below. 

 

After these steps, create a form for the Organization Chart and give it a name. Since we will not saveto the database, choose Report as the form type and drag the Organization Chart onto it. 

Click the Organization Chart we dragged; its properties open on the right. 

At this stage, first write the query that provides our data in Organization Query and choose the Edit Form. After that, data is loaded into the 'Parent', 'Name', 'Title', 'Avatar', 'Expand' drop-downs above; choose them with the small triangle icons on their right. The image below shows them mapped. 

 

 

To make the Organization Chart run automatically when the form opens on the Client screen, first select the form on the left in the Studio screen containing the Organization Chart. Then go to the actions section on the right and click Add New Action. 

Define and save the When the form is opened > Update Value > OrgChart_1 action. 

 

 

Save the screen and go to the Client screen with run. 

On the Client screen the organisation chart looks as below. 

 

Editing, Creating and Deleting on the Organization Chart 

The Organization Chart gives users easy access to work on each record. Clicking the three-dot (⋮) icon, on any record shows the options below: 

  • Edit: Click to update the information of an existing record. 
  • Delete: Removes the record from the organisation chart entirely. 
  • Create: Adds a new position or person to the organisation chart. 

These functions become active when the Edit, Create and Delete buttons in the properties of the Organization Chart tool are set to “Yes” This setting allows dynamic changes to the chart on the client side and increases user interaction. 

 

Let's add the Head of Pediatrics under the chief physician Dr. Alice Young: hover over the three-dot icon as in the image below and click Create; the edit screen opens. Enter the information as below and click save.