Bravo Studio Help Center
  • Get started with Bravo Studio 👏
  • Get Started
    • 🚀Create your first app
    • 🌟Bravo introduction
      • Get ready to create your app with ChatGPT
      • Create an app
        • Creating an app with Figma
        • Creating an app with Adobe XD
      • Duplicate an app
      • Delete an app
      • Replace linked Figma file
      • The app page
      • Sharing your app
      • Add an editor to your app
      • Fonts
        • Adobe XD - Supported fonts
    • 📱Bravo Vision previewer
    • ✨Unlock power features to create interactive apps
    • 🎓Help and tutorials
      • 📖App guide tutorials
        • Sample app tutorial: Your first binding
        • How to build a Fitness app with Bravo, Xano and RevenueCat
        • Foodgram: Social content sharing
        • Expedition journal: Write and share your adventures
        • My Subscriptions: Display data based on device ID
        • My Notes: using user ID and email from Firebase
        • My Store: Sell physical products with Bravo and Stripe
        • Titan: How to create a Smart Home App with No-Code?
        • n8n: Building an expense tracking app in 10min
      • 📺Learn with videos
      • 📚Learn with articles
      • 🗃️Browse by app feature
        • Save or "bookmark" a page
        • Backend search with Airtable
        • Backend search with Xano
        • Nested lists (list within a list)
        • Create and edit user profile (Firebase + Airtable)
        • Skeleton loader
        • Create albums in your app with Bravo Infinite images
  • Set up your design
    • 🖌️Get your Figma ready for Bravo
      • 🗃️Structuring the design: the layer hierarchy
      • 🪄Bravo Tags: adding functionality to the UI elements
      • 🧱The container
        • Setting up a container on Figma
        • Setting up a container on Adobe XD
      • 📲App navigation
        • Setting up app navigation on Figma
        • Setting up app navigation on Adobe XD
    • 🔌Bravo plugin for Figma
    • 💾Sample design files
    • 🤓Best Practices
  • App components
    • 📒Bravo Tags Master List
    • 🚪Menus
      • Modal Menu
      • Modal pages
      • Tabs Menu
      • Pop Up pages
      • Slide Menu
    • 🍞Pages
      • Modal pages
      • Pop-up pages
      • Swipe page
      • Transitions page
      • Page reveal animations
      • Page tabs
      • 🔮Stateful pages
    • 📦Containers
      • Swipe to delete
      • Top bar
      • Carousel slider
      • Aspect ratio relative to screen
      • Sortable List
      • Layer (sticky element)
    • 👋Intro & Onboarding
      • Intro page
      • Post-login page (Onboarding)
    • ⌛Loading experience
      • Loading page
      • Custom loading page
      • No loading
      • Preload
    • 📝Form & input fields
      • 👁️Password Visibility Toggle
      • 🩷Stateful input
        • ☑️Checkboxes (Multiple select)
        • ✅Required Checkbox
        • 🔘Radio buttons (Single select)
      • ⏳Input time Interval
      • 📄Dropdown selector
      • 🎚️Slider control
      • 🗓️Calendar picker
      • 📄Send form input to a database
    • 💎Components
      • Autoplay Video
      • GIF
      • SVG Component
      • Web view
      • Web Components using AI
      • Web view communication
      • LottieFile
      • Lottie-animated component
      • Flexible text (Flexo)
      • Zoomable image
      • Component states
      • Stateful component (like button)
      • Setting up the backend of Stateful component (like button)
      • Haptic Feedback (Buzzz)
      • Progress bar
      • Rich text
      • Date, Time and Currency Formatter
      • Scrollable text
      • Text Lines & Truncation
      • Status bar
    • ⚡Mobile actions
      • Mobile Actions
      • Play audio
      • Record audio
      • Play video
      • Scan QR code (external URL)
      • Scan codes (remote action)
      • Search & filter
      • Refresh page
      • Share location
    • 📱App Icon & Splash Screen
    • 🗺️Map with markers
    • 📈Charts
  • Data and Backend
    • 🗂️Set up a no-code backend
      • Xano
        • Nested lists (list > list > detail page) with Xano
        • Create a bookmark functionality with remote actions and device ID with Xano
        • Multi-user setup with Xano
        • 🔒Setting up the Xano Log in Snippet
          • ♻️Refresh Token
      • Airtable
        • Nested lists (list > list > detail page) with Airtable
        • Sort list with Airtable
        • Connect multiple tables from Airtable to one app
        • Update Airtable's API key to Access Token
      • Backendless
      • Bubble
      • Notion
        • Getting data from a Notion table
      • Firebase
        • Getting data from Firestore
    • 💾Set up API requests
      • Set up from scratch
        • Airtable
          • Set up an API GET request for list page - Airtable
          • Set up an API GET request for detail page - Airtable
          • Set up an API POST request - Airtable
          • Set up an API DELETE request - Airtable
        • Xano
          • Set up an API GET request for list page - Xano
          • Set up an API GET request for detail page - Xano
          • Set up an API PATCH request - Xano
          • Set up an API POST request - Xano
          • Set up an API DELETE request - Xano
      • Using GraphQL body type
      • Set up with API wizard & importer
        • Using the Airtable API Wizard
        • Using the Xano API wizard
    • 🎲Variables
      • Built-in variables
      • Set Variable
    • 📚Data Collection & Binding: Complete Collection
    • 🗂️Pagination
    • 🐛Debugging API issues
      • ⚙️Debugging requests in the API Collection
      • 📲Event logger
      • 🔗Link property
  • Data binding
    • 🤝Data binding types
      • API binding types
      • Bind multiple API requests to one screen
      • How to connect my API to a mobile actions
      • Remote actions: trigger an API request with a UI element
    • 💡Display data in your app
      • Bind data to design for a list page
      • Bind data to design for a detail page
    • 🆕Create data from your app
    • 🗑️Delete data from your app
    • 🚦Conditional Visibility
    • 🎛️Conditional Actions
  • Integrations & Settings
    • 🖇️Deep Links
      • 🖇️Deep Links for Bravo Vision
      • 🖇️Deep Links for published apps
      • 🖇️Troubleshooting Deep Links
    • 🔔Push Notifications with OneSignal
      • How to get a Bravo page URL
    • ⚙️Firebase Configuration
    • 🔐User Authentication
      • 🔑Authentication with Kinde and Xano
      • 🧙🏽Authentication with OAuth 2.0
        • Using social logins to authenticate users
        • Using AWS Cognito to authenticate users
        • Connecting to Spotify API
      • 📲User login with Firebase
        • ✉️Email and password Login with Firebase
        • 📞Phone Login with Firebase
        • 🍎Social Login with Firebase
        • 👻Anonymous Login with Firebase
      • ⛓️Authentication with custom backend
        • Set up Xano as your user authentication backend
    • 💰Stripe: One-time Payment
    • 💬Chat: CometChat
    • 💸RevenueCat: In-app purchases and subscriptions
    • 📉Bravo Analytics
    • 📳Facebook App Events
    • 📊Google Analytics
    • 🌐Multilingual apps
    • 🕸️How to connect with Webflow API
    • 📡NFC connection
    • 🎯Admob
  • App Publication
    • 🚀Publishing your app
      • iOS Publication: Complete Process
        • 1. Generate Certificates, AppIDs and Provisions
        • 2. Get the IPA
        • 3. Upload IPA to App Store Connect
        • 4. Test your app on TestFlight (optional)
        • 6. App Store publication
        • 7. Updating an app in the App Store
      • Android Publication: Complete Process
        • 1. Create a Keystore File (optional)
        • 2. Get the Debug APK to install
        • 3. Install the Debug APK in your device
        • 4. Get the AAB (Android App Bundle) file to publish
        • 5. Google Play publication
        • 6. Updating an app in Google Play
      • Android APK Installation Guide
      • Rejection from the app stores
    • 🎛️Making changes to your app after publication
    • 🛍️Versioning
    • 🌟App rating alert
  • Good to Know
    • 🤔Troubleshoot
      • Errors when logging in
      • Errors when creating an app
      • Errors in API requests
        • Request timeouts on Bravo
      • Errors after importing
      • Errors in publication form
    • 🧑‍💻Manage your account
    • 💳Billing
      • Bravo Subscription Plans Overview
      • App Add-ons
      • Upgrading a plan
      • Downgrading a plan
      • App allowance
      • Invoices & payment method
      • FAQ
    • ❓FAQs
      • About Bravo Studio
      • Importing a design file
      • Bravo Vision
      • Bravo Tags
      • API & Data Library
      • Login & Account
      • Other Features
  • NEED SOME HELP?
    • 📖Bravo Support Guide
    • 🤝Join the Bravo community
    • 🤖Bravo Assistant
    • 👥Production support
    • 🐞Report an issue
Powered by GitBook
On this page

Was this helpful?

  1. Data and Backend
  2. Set up API requests
  3. Set up from scratch
  4. Xano

Set up an API PATCH request - Xano

PreviousSet up an API GET request for detail page - XanoNextSet up an API POST request - Xano

Last updated 10 months ago

Was this helpful?

to the Bravo Solo plan to use this feature.

The Data Collections feature enables you to create API requests to any database or tool with an available REST API. In this guide, we'll show you how to set up a PATCH request to edit data in an external database from your app.

You can use other API verbs (i.e. PUT or POST) to create data if your API specifies otherwise. Simply change the verb type of the request URL.

Example Figma file

If you don't have a design yet, import it to Bravo. You can also duplicate this .

Database

In this guide, we're using Xano database to manage our app's backend. The Xano platform offers a powerful and flexible solution to handle data efficiently. Our focus will be in the user table, which is a critical component in most apps as it stores user related information.

To facilitate various operations on this table, Xano has auto-generated CRUD (Create, Read, Update, Delete) operations. These operations are essential for managing the data lifecycle in our application.

The CRUD operations provided by Xano enable us to:

  • Create: Add new user entries to the database.

  • Read: Retrieve user information stored in the database.

  • Update: Modify existing user data.

  • Delete: Remove user entries from the database.

If you are using a different backend tool, refer to its API documentation to understand how to construct the request, including both the URL and the body.

How to set up a PATCH request

1. In Data Library, click Create a New Collection and select Start from scratch. If you already have a collection, select your desired API Collection.

You can also import your API collection using the Xano Wizard, Open API, Postman or Swagger.

A Collection is a group of API requests, usually for the same data source.

  1. Enter a name and description. If already done, skip this step.

  1. To create a new request, click the + button in your collection and enter a name. We'll call this example "Edit my profile".

  2. To update user information use a PATCH API request. Copy the endpoint URL autogenerated in Xano.

The typical Xano endpoint structure is:

https://api.xano.com/your-endpoint/{user_id}
  1. In Xano, navigate to "Run & Debug", and copy the existing JSON body.

  1. In Bravo, navigate to the API request Body section, choose JSON, and paste the copied JSON from Xano.

{
  "user_id": ${user.id},
  "name": "${name}",
  "email": "${email}",
  "phone": ${phone},
  "bio": "${bio}",
  "plan": "${plan}",
  "privacy": "${privacy}"
}

For text input, include the quotation marks, like "${input}". For number input, do not include the quotations, like ${input}

  1. Let's send a test request to our database to verify that the request is correctly constructed. Navigate to the Input Variables & Test Values tab within the API request and provide sample data for the previously defined variables in the JSON body. In this example: 1 for ${user.id}, Robin for ${name}, etc.

The key name for the Test Value must match the defined Variable Name exactly, including case sensitivity.

If the PATCH request is configured correctly, the example content will be stored in your database. 11. In step 2, we set the Authentication type to Bearer and left the Token field empty. To authenticate the request, go to the "Input Variables & Test Values" tab, add "_authorization" as variable and enter the token in the value field.

  1. After setting the values and authenticating the request, click Send. The specified record in the table will then be updated with the provided test data.

  2. If the request is successful, you'll receive a response message containing data from the API endpoint. This data will depend on the backend configuration. In this example, you'll get data corresponding to the row you just updated.

To verify the HTTP response body, go to the Debug & Inspect Response tab. A Status Code: 200 - OK indicates successful data retrieval.

After setting up the API request, bind the form using the guide below:

To set up the PATCH request in the backend, follow This example also demonstrates how to use the required JSON body to edit a record in the table.

The API documentation specifies any Headers, Parameters, and/or Body value needed in order to make the PATCH request. In this example, Xano uses the to authenticate the request. In Collection settings, set the Authentication type to Bearer and leave the Token field empty.

Select the request type as PATCH and add the endpoint URL, replacing the {user_id} with ${user.id}. , like ${user.id}, auto-fill dynamic content in the app.

We will replace the values in the example request body with variables while keeping the same key names ("user_id", "name", "email", "phone", etc.), as these match the Xano column names. To define a , we'll use this notation: ${input}. In our case, we'll define the variables ${name} ,${email} ${phone}, etc. but you can use any variable name you prefer. Permitted characters: lowercase a-z, uppercase A-Z, 0 to 9, underscore (_) and dash (-). No spacing. Later on, when binding the UI elements of our app to the API requests, we'll specify which elements are bound to which variables. For instance, if we have a connected to this post request, we'll bind each input field to one of the variables we defined in the JSON body.

You can use a to make sure the JSON snippet you copied is syntactically correct, and avoid getting errors later on.

On the other hand, if the request was not successful, you will get an as a response. In this case, review and double check your JSON body and URL to be correct.

Finally, rename the variables in the Output Variables section to align with the user table API request names for proper data binding. More about .

💾
Xano's API documentation.
bearer token method
Built-in variables
variable
form
JSON validator
HTTP error
Variables
👉
👉
Upgrade your free account
Figma file
LogoSend form input to a database | Bravo Studio Help Center
User Database in Xano
User CRUD endpoints autogenerated in Xano
Create a new collection
Collection settings - Bearer Token
PATCH Endpoint in Xano - Run & Debug
PATCH API request in Bravo
Input Variables & Test Values
Authenticating API request
Selected data in the Received data tab of an API request
Output Variables of a PATCH API request