FM BetterForms
BF Editorfmbetterforms.com
1.0 dont use
1.0 dont use
  • Introduction
  • Features Summary
  • Getting Started
    • System Overview
    • Integration
      • 1. Configure FileMaker Server
      • 2. Add your Server to BetterForms
      • 3. Introduction to Hooks
      • 4. Create your first Site
      • 5. Create your first Page
      • 6. Configure your FileMaker File(s)
      • 7. Run your first Hook
      • Next Steps
    • Common Customizations
      • Introduction to Actions
      • Introduction to Buttons
      • Page Navigation
      • Displaying Data in a Table
    • Support
      • Hacking a Webpage
      • Learning JSON
  • Reference
    • Site Settings
      • Navigation
      • Slots / Code Injection
      • App Model
      • Site-wide Named Actions
    • Page Settings
      • Data Model
      • Card / Window Modals
      • Validation
        • Custom Validators
      • Misc Page Settings
    • Page Elements
      • Common
        • Button
        • Data Table
        • HTML
      • Grouping Elements
        • Tabs
        • panel
        • accordion
        • listrows
      • Uploading Files
        • dropzone
        • dropzone to S3
        • uploadCare
      • Misc Elements
        • Plain Text / Code Editor
        • signature
        • fullCalendar
        • rangeSlider
      • Payment Gateways
        • Authorize.net
        • PayPal
        • Stripe
      • Adding Custom Page Elements
    • Actions Processor
      • Named Actions
      • Actions
        • runUtilityHook
        • path
        • debounce
        • throttle
        • showAlert
        • showModal / hideModal
        • function
        • clipboard
        • cookie
        • setFocus
        • wait
        • emit
        • validate
        • channelJoinAnon
        • channelLeaveAnon
        • messageSend
        • messageSendAnonChannel
      • Authentication Actions
    • Script Hooks
      • Globals Variables
        • $$BF_Model
        • $$BF_App
        • $$BF_State
      • Keeping Keys Private
      • Reducing Payload Size
      • API Callback Endpoint
      • Common Hooks
      • Scoped Hooks
    • Users & Authentication
      • Managing User Accounts
      • Custom Login Pages
    • Advanced Configuration
      • Custom Domains
    • BF Utility Functions
    • BF Error Codes
    • Messaging
      • Adding users to channels
      • Removing users from channels
      • Sending messages
      • Get connected users
      • Get active channels
  • Usage Tips
    • Troubleshooting
      • Debugging
      • Frozen Actions Queue
    • JavaScript Tips
      • Calling Named Actions from HTML Vue Events
      • Calculations
    • System Overview
    • Forms Processor
      • Form Types
      • HTML & VueJS
      • Styling and Design
      • JS Caclulations and Functions
    • Customizing and Styling
      • Custom Components
      • Custom CSS
      • Custom Components
      • Page Pre-loaders
      • Favicon
    • Design Patterns and Best Practices
      • Working with environments
      • Handling Data
      • Saving Data
      • Optimization
      • Business Logic
      • UI / UX
  • Security
    • Authentication
    • Security White Paper
    • Firewalls
    • Technology Stack
  • Compatibility
Powered by GitBook
On this page
  • What is a Page?
  • The Data Model
  • Page Schema
  • Creating a Page
  • Add some Data
  • Viewing your Page

Was this helpful?

  1. Getting Started
  2. Integration

5. Create your first Page

Previous4. Create your first SiteNext6. Configure your FileMaker File(s)

Last updated 3 years ago

Was this helpful?

What is a Page?

Think of a page like a FileMaker layout. It will contain any combination of fields, buttons, data tables, text, labels, etc. that you place onto it. The primary difference is that a BetterForms page is not tied to a Table Occurrence, but will have access to whatever data you pass into it individually through the Data Model.

This guide assumes that you already have a working knowledge of basic JSON formatting and terminology. If you have never worked with JSON before, we recommend you first.

The Data Model

All data that can be seen by the page lives in the data model. The data model is merely a JSON object that can be pre-populated with data from your FileMaker Server, then modified by the user through simply input fields.

When you run a , the data model is passed with the request so that you can save the data back to your FileMaker database.

Page Schema

The page schema is where you define the elements that live on your page. It's also in JSON format!

The fields array is the list of on your page. When you get to building your own pages, you can use the section to learn more about how each element works.

If you're familiar with HTML, you know that pages are built from the top of the screen down by default without specifying any position information, and the same concept is at play here. Using Bootstrap CSS, you can specify how wide an element should be, then the elements stack on the page accordingly.

Creating a Page

If you haven't already, create a new page. Click "New Page" from the Pages menu to follow along! Your initial page will have some default elements, then we'll add another one just to view some data.

You'll need to set a for the page, but the page name and description can remain at their defaults for now.

For this form, let's turn the Authentication toggle to off ("No Auth") so that we don't have to worry about a login page for this form

In the Schema Editor tab, search the snippets for "HTML" and click the copy button for HTML - Data Model Inspector to copy it on your clipboard. This snippet is a JSON object that we'll paste at the end of the fields array. Don't forget to include a comma between the last element and the new one!

When you're done, the bottom of your schema should look something like this:

[{
    "schema": {
        "fields": [{...}, {
            "actions": [{
                "action": "validate"
            }, {
                "action": "showAlert",
                "options": {
                    "text": "Replace this action with an runUtilityHook",
                    "title": "Replace me!",
                    "type": "information"
                }
            }],
            "buttonClasses": "btn btn-info",
            "hint": "This button schema has an actions key that takes an array of actions. Actions after the validate will only run if validation is successful.",
            "label": "My Button",
            "styleClasses": "col-md-6",
            "text": "Validate and Run Actions",
            "type": "button"
        }, {
            "html": "<pre>{{model}}</pre>",
            "label": "Data Model Inspector",
            "styleClasses": "col-md-6",
            "type": "html"
        }]
    },
    "showPanelHeader": true,
    "title": "This is the form panel header, this text is in the formSchema. hide with misc setting key 'showPanelHeader'"
}]

The schema editor might seem overwhelming at first, but it's actually very well organized. To help you understand the structure, try clicking the triangles near the line numbers to collapse objects or arrays down and help you get your bearings!

Add some Data

In the Data Model tab, add a few JSON items so that they exist on the page. The element that we added to the schema will display this data on the page so that we can see if it's working properly. For example:

{
    "nameFirst": "John",
    "nameLast": "Doe"
}

Viewing your Page

Don't forget to save your page before previewing it in a new tab!

Go ahead and preview this page in your own site to make sure all the elements appear correctly. You should see the Data Model displayed as plain text below the button.

Alternatively, while you're learning you may find it useful to use a JSON editor like . Simply copy/paste your JSON in there to view it in a different format.

You can always click the Preview button in the page editor to view your page rendered, however you often want to preview it within your own site. To do this, simply replace the app.fmbetterforms.com part of the URL with your own domain as configured in your .

jsoneditoronline.org
site settings
start here
Scoped Hook
elements
reference
Scoped Hook Set Name