LogoLogo
  • A better way to do...stuff!
  • How we build the app
    • Overview
  • Documentation
    • Draftbit
      • Using Live Preview
      • Workspaces and Billing
      • Introduction to the Builder
      • Layout
      • Intro to Navigation
      • Fetching Data
      • Direct Integrations
      • FAQs
      • Draftbit
      • Draftbit
      • Custom Blocks
      • Borders, Background, and Elevation
      • Actions
      • Custom Screen Code
      • Exporting and Publishing Your Project
      • Sharing Your Project Online
      • Publishing Your App as a PWA
      • Stack Navigator
      • Tab Navigator
      • Draftbit
      • Draftbit
      • Basic
      • Media
      • REST Services & Endpoints
      • REST API Integrations
      • Themes & Styling
      • Submitting Data
      • Draftbit
      • Draftbit
    • Xano
      • resources-and-tips-1
        • 🎞️ Xano Video Tutorials
        • 🤝Community Corner
        • 💰Share Xano. Make money
      • FAQ
      • getting-started
        • ⚡ Jumpstart
        • 🎞️ The Xano Interface
      • instances
        • What is an Instance?
        • Early Access Instance
        • Upgrading an Instance
        • Sharing
        • Bandwidth Usage
        • API Rate Limit
      • What is a Workspace?
      • Dashboard
      • Database
      • Airtable Import
      • API
      • Library
      • Marketplace
      • Settings
      • authentication
        • Authentication
        • Sign-up & Log in
      • data-manipulation
        • The Function Stack
        • Addons (GraphQL-Like)
        • The Expression Builder
        • External Query Manipulation
        • Timestamp
        • Filters
        • Images
    • Expo
      • Creating your first build - Expo Documentation
    • Kommunicate
      • Installation
      • Installation
      • Installation
      • Installation
      • Installation
      • Flutter Installation
      • Installation
      • Zapier Integration
      • Authentication
      • CMS Installation
      • Authentication
      • Conversation
      • Conversation Assignment
      • Customization
      • Localization
      • Logout
      • Web Troubleshooting
      • Installation
      • Authentication
      • Push Notification
      • Conversation
      • Customization
      • Localization
      • Logout
      • Installation
      • Authentication
      • Push Notification
      • Conversation
      • Customization
    • Formito
      • basics
        • Getting Started
        • Variables
        • Are you GDPR ready?
        • How to prefill the values of my chatbot?
      • connect
        • How to connect Formito to Zapier?
      • convert
        • How to convert old formito chatbots to the new version?
        • How to convert Google Forms into a chatbot?
        • How to convert a Monday.com board to a chatbot?
        • How to create chatbot from QuickBase table?
      • guide
        • How to add my chatbot to WordPress?
        • How to create a chatbot for Zendesk?
      • shopify
        • How to embed my chatbot into a Shopify page?
        • How to display Formito chatbot on bottom corner of my Shopify store?
        • How to open my chatbot after clicking on links or buttons?
    • Stonly
  • Flex Stuff
    • App
    • APIs
    • Database
    • Website
    • Design
    • Style Guide
  • Content
    • Guides
    • ChatBots
    • Blogs
    • Whitepapers
  • Company
    • About us
    • Brand
    • Roadmap
    • Policies
  • Flex Together
    • Overview
    • Fair Finance
Powered by GitBook
On this page

Was this helpful?

  1. Documentation
  2. Draftbit

Fetching Data

PreviousIntro to NavigationNextDirect Integrations

Last updated 4 years ago

Was this helpful?

With the Fetch component, you're able to easily pull live data from a third party RESTful API directly into your apps in Draftbit.

🚧

For security reasons, it's recommended that you use the APIs and Services method to save your API configuration when Authentication is needed.

If you don't have your own data but would like to try the feature, feel free to grab some sample data from Draftbit's service. For this example, we'll use the /users endpoint.

To get started, make sure your Layer Tree is set up similar to the picture below.

📘Make sure the 'Fetch Render Item' of the List is set to Data

Read more about the different Fetch Render Item settings

Select the Fetch component in the Layer Tree and go to the Data tab of the Properties Panel. Select a Service from the dropdown. You are also able to configure a new Service directly from the Fetch component (check the articles for more information on the configuration options). Once you've selected a Service, you can also select or create an Endpoint as well.

To pass the data to the data-enabled components inside of the List, select the List in the Layer Tree, and change its Mapped Data Value to data. Next, select the data-enabled component in the Layer Tree and change its Mapped Data Value to the property you'd like it to display.

🚧

When configuring an Image component, there’s no validation built-in to ensure you’re passing an image URL to the component. If you find it not working, double check your data in the Results section of the + Build Query modal.

🚧Working with Images in Airtable

Once you’ve created a Base and entered your data, click the question mark in the top right corner and select API Documentation in the dropdown.

On the API Page for your Base, scroll down to the Authentication section. In the top right, click the show API Key checkbox so that your API Key populates the placeholder in the example URLs.

Once you’ve generated the API Key, go back to the builder, add the Fetch component to your screen (you can use the same set up as the above example) and enter your Base’s URL and the API Key under the Headers.

❗️Entering API Keys in the Headers section of the Fetch component exposes the API Key in code.

Instead, it is recommended that you save your API Key under Global Variables.

Add a List component inside the Fetch component like before. While the List is selected in the Layer Tree, go to the Data tab of the Properties Panel and set the Mapped Data Value to data.records.

📘

As a general note, make sure to set the top level of data as the Field for List components.

After you've configured the List, you can pass data to Text and Image components by selecting the Mapped Data Value that corresponds to the Field (column) Names of your Airtable Base.

If you've never used Airtable before and are interested in using it as a database, check out their that will tell you everything you need to get started.

If you've uploaded your images directly into Airtable with the 'Attachments' field type, make sure to change the field type to 'Single Line Text' so the only thing in the field is the actual image URL (ex. ).

Updated about a month ago

documentation
https://dl.airtable.com/...
Table of Contents
What Components Are Data-Enabled?
JSON
Airtable
Example Data
here
REST Services & Endpoints