This article explains the features of the "Get Data from Database" block, which allows you to fetch data from an external or organizational database and use it within your Clappia app.
The "Get Data from Database" block works within the Design App phase and connects Clappia to an external database. Once configured, it fetches data from the database dynamically when the app is used.
Click on the "Get Data from Database" block and start editing on the right panel.
The label is the name of the block that the end user sees in the app.
Example: "Fetch Employee Details" or "Get Stock Info".
The description is the additional information provided to the end user, displayed below the input area. You can also leave this blank if not necessary.
Choose the type of database you want to connect to from the dropdown.
Supported options: MySQL, PostgreSQL, AzureSql
Enter the hostname or IP address of your database server. This is typically provided by your IT team or database administrator. For example:
Specify the port number for your database connection.
Example: 3306 (MySQL) or 5432 (PostgreSQL).
Provide the login credentials required to access your database. These are assigned by your database administrator. Ensure the account has read permissions for the required tables.
Specify the name of the database where your data is stored. The name must match exactly as it appears in your database. For example, if your database is called employee_data, you must enter employee_data.
Click "Authenticate" to test the connection. If successful, additional fields will appear for query configuration.
Once authentication is successful, you can define the query to fetch data.
Example of a database table:
Write an SQL query to fetch data from the database. Use conditions to filter results dynamically.
Example:
SELECT * FROM employee_table;
Ensure that your query retrieves only the required data.
Add the column names from your database query as Output Fields. These must match the exact column names in the database.
Once Output Fields are defined, corresponding output variables are automatically generated. These variables can be used to display specific values from the database in other fields of the app.
This field allows you to set a custom message that will appear when no records match the query you have specified.
Example: If the query does not return any data, you can display a message like "No matching records found."
Leave this field blank if you do not wish to display a message in such cases.
Toggle this option to make the Get Data from Database block mandatory for app submission.
When enabled, users must interact with the block (fetch data and make a selection) before submitting the form.
If this option is disabled, the block becomes optional, and users can proceed without fetching or selecting data.
Use this option to show or hide the field under specific conditions. It accepts the standard Clappia formulae, similar to conditional sections or in the ‘Calculations & Logic’ block.
This option appears once a condition is set in the Display this field if option. Enable this setting if you want the field's value to be retained even when the field is hidden. This is useful for preserving user input in cases where the field may temporarily disappear based on conditions.
Example: If the field is hidden based on user selection but you still need to keep the entered value for future reference or calculations, enable this option to ensure the data is retained.
This option is enabled by default. When active, end users can edit the value entered in this field after creating a submission. Disable this option if you want the initial value to remain uneditable once submitted.
Desktop View: Set the width of the PDF Viewer block in the desktop view. Options are 100%, 75%, 50%, or 25%.
Mobile View: Set the width of the PDF Viewer block in the mobile view. Options are 100% or 50%.
When the app goes live, users can interact with the "Get Data from Database" block.
L374, 1st Floor, 5th Main Rd, Sector 6, HSR Layout, Bengaluru, Karnataka 560102, India
+91 96418 61031
3500 S DuPont Hwy, Dover,
Kent 19901, Delaware, USA
+1 (341) 209-1116
3500 S DuPont Hwy, Dover,
Kent 19901, Delaware, USA
+1 (341) 209-1116
L374, 1st Floor, 5th Main Rd, Sector 6, HSR Layout, Bengaluru, Karnataka 560102, India
+91 96418 61031