(Deprecated) Budibase Docs
  • 👋Introduction
  • Quickstart tutorials
    • Build a CRUD app
      • Importing the Vehicles table from a CSV
      • Creating the Service log table from scratch
      • Listing recent Service Logs on the home screen
      • Creating a new Service Log with a modal
    • Build a CRUD app- SQL
      • Connecting to your SQL tables
      • Creating Screens from your SQL tables
      • Using relationships between SQL tables
      • Creating a List screen from scratch, using a SQL table
      • Creating a new log, with a modal
    • Build a CRUD app - REST
      • Adding a REST datasource
      • Creating a query that Lists Issues
      • Using your request to display items in your app
      • Add a “Create Item” request
      • Create a new todo Item, inline
      • Mark todo items as “Done”
      • Finishing Touches
  • Building apps
    • Data
      • Users table
      • Data sources
        • Internal/CSV
        • PostgreSQL and MySQL
        • REST
          • REST Queries
          • REST Bindings Example
          • REST Query Import
          • REST Authentication
          • REST Variables
        • Other sources
      • Data Types
        • Text
        • Number
        • True/False (Boolean)
        • Date/time
        • Options
        • Attachments
          • Example
        • Relationships
          • Example
        • Formula
        • JSON
      • Views
        • Filters
        • Calculations
        • Groups
      • Transformers
    • Design
      • Screens
      • Layouts
      • Components
        • Section
        • Container
        • Data Provider
        • Repeater
        • Table
        • Chart
        • Card
        • Text
        • Button
        • Link
        • Icon
        • Image
        • Embed
      • Forms
        • Form Component
        • Field Groups
        • Fields
      • Bindings
      • Actions
      • App State
      • Conditions
      • App theming (coming soon)
      • Handling Data
        • Search/Filter Data
    • Automate
      • Automation steps
        • Triggers
        • Logic
        • Actions
      • Activating and testing
      • Contextual bindings
    • Admin and management
      • User Management
      • Authentication and SSO
        • OpenID Connect
        • SSO with Auth0
        • SSO with Azure AD
        • SSO with Okta
        • SSO with OneLogin
        • SSO with Google
        • SSO with Keycloak
      • Email
      • Portal
      • User Settings
  • Guides
    • Display user-related data
    • Add search
    • Add filtering
    • Create public & private screens
    • Writing a custom SQL query
    • Create a child record from the parent
    • Items assigned to me
    • Master-detail
  • Self-hosting
    • Get started
      • Budibase CLI Setup
    • Hosting methods
      • Overview
      • DigitalOcean
      • Kubernetes (K8S)
      • Docker compose
    • Hosting settings
      • Advanced options
        • Reverse proxy
    • Accessing CouchDB
    • Accessing MinIO
  • References
    • Budibase architecture
    • Deployment information
    • Troubleshooting
    • Contributing to Budibase
      • Writing Your Own External Data Connectors
Powered by GitBook
On this page
  • Creating Countries Table and Columns
  • Creating Rows and Uploading Data
  • Frontend
  • Edit Country Attachments
  • Delete Country Attachments
Export as PDF
  1. Building apps
  2. Data
  3. Data Types
  4. Attachments

Example

Fun with Flags

PreviousAttachmentsNextRelationships

Last updated 4 years ago

In this example, we will be creating a simple web application that will be used to store information about different countries around the world. Some of the information we are going to include in our application:

  • Country Name

  • Country Population

  • Country Flag

  • Travel Guide

Creating Countries Table and Columns

Let's begin by creating a to store data for our countries.

Next, we need to create columns in our Countries table. Let's look at the information we need to include about each country and decide which data types are the best to use for our columns.

  • Country Name: Country names are just letters, so a Text type is a good fit here.

  • Country Population: We should use a Number type for this.

  • Country Flag: This will require an image file - here is where Attachment types come in.

  • Travel Guide: We can store PDF travel guides for each country here. Let's use another Attachment type.

Watch the video below to find out how to set up your table as detailed above.

Creating Rows and Uploading Data

Now that we have set up our columns, we can start to add some rows to our Countries table. You will now notice that on row creation, you will be presented with dropzone components inside the row creation popover for both of our attachment types - Flag and Travel Guides.

Let's create an row for Spain. Follow along with the video below to find out how.

Here are the files used in the video below if you don't have your own:

Muy bien! 🇪🇸

Let's see what's been automatically created for us in the frontend of our app.

Frontend

  • Countries - New: A screen with a form that can be used to create a brand new country.

  • Countries - List: A screen with a table containing all the countries in your countries table.

  • Countries - Detail: A screen used to represent a single country. When you click the View button in the Countries List table, you will be navigated to the detail page for that country.

Let's preview our application and interact with our attachments! Click the preview button on the top right of the builder. You will be navigated to your app in your default browser. Log in with the credentials that you set up when you initially created your app and you will see the homepage of your new app. Navigate to the automatically created "Countries" link in your navbar - you should see your countries listed in a table:

Let's dive into some of the different ways we can interact with attachments in our application.

Edit Country Attachments

Let's edit our Spain row to add another travel guide. This involves navigating to the detail view for Spain and adding another PDF file.

Delete Country Attachments

You can delete an attachment from the Country table or the Country Detail Screen. Let's delete one of our travel guides from the table view, and the other one from the detail view.

Navigate over to the "Frontend" tab in the builder. You will notice that some have been created for us when we created our Countries table.

Spanish Flag Image
Spanish Travel Guide
screens
table