🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Appwrite Premium Add-on Setup Guide

Updated 8 min read Gravity Forms Integrations A–Z
On this page
  1. Video walkthrough
  2. What you need
  3. A quick map of Appwrite
  4. Create a database, collection and API key
  5. Install and connect
  6. Create a feed
  7. What happens on submit
  8. Merge tags and notifications
  9. A failed call never blocks the submission
  10. Change the document with a filter
  11. Security and privacy
  12. Troubleshooting
  13. Frequently asked questions

Video walkthrough

Gravity Forms Appwrite Add-On Setup Guide: Entries to Documents (WordPress Side)
Video setup guide: Gravity Forms Appwrite Watch on YouTube

The Gravity Forms Appwrite Premium Add-on connects your WordPress forms to Appwrite, the open-source backend server and self-hostable alternative to Firebase. When someone sends a form, the add-on creates a document in your Appwrite database collection, with each form field mapped to a collection attribute. Your submissions land in your own backend, ready for an app, a dashboard or an automation to read.

It works with Appwrite Cloud and with a self-hosted Appwrite on your own server. You enter your endpoint, your project id and an API key; the key is stored encrypted, and the add-on only ever contacts the endpoint you set. This guide walks through the setup, every feed option, merge tags, notifications and what happens when something goes wrong.

What you need

  • WordPress with Gravity Forms 2.5 or newer.
  • PHP 7.4 or newer.
  • An active license key for this add-on.
  • An Appwrite project (on Appwrite Cloud or self-hosted) with a database, a collection and an API key that may write documents.

If Gravity Forms is missing or older than 2.5, the add-on shows a notice in the WordPress admin and does nothing else, so a form is never left half connected.

A quick map of Appwrite

Appwrite organises data as databases, each holding one or more collections (like tables), and each collection holds documents (like rows). A collection defines attributes (like columns) with a type, such as string, integer, boolean or email. This add-on creates one document per submission in the collection you choose, so the attribute keys you map must already exist in that collection.

Create a database, collection and API key

  1. In the Appwrite Console, open your project and go to Databases. Create a database if you do not have one, and note its Database ID.
  2. Inside the database, create a collection and note its Collection ID. Add the attributes you want to fill, for example name, email, plan and message, each with a suitable type and size.
  3. Open Overview → Integrations → API keys and create a key. Give it the documents.write scope (and databases.read so the connection test can read the database). Copy the key now; Appwrite shows the full value once.
  4. Find your Project ID under Settings, and your endpoint. On Appwrite Cloud the endpoint is https://cloud.appwrite.io/v1; on a self-hosted server it is your own address ending in /v1.

An API key acts with the scopes you grant it, so a key limited to documents.write on this project can only ever create documents. That keeps a form key narrow by design.

Install and connect

  1. Upload and activate the add-on in Plugins → Add New → Upload Plugin.
  2. Open Forms → Settings → Appwrite, paste your license key and activate it. The Appwrite fields appear once the license is active.
  3. Enter the Appwrite endpoint, such as https://cloud.appwrite.io/v1 or https://appwrite.yourcompany.com/v1. It must be https.
  4. Enter the Project id and paste the API key.
  5. Enter the Default database id. A feed that leaves its own database empty uses this one.
  6. Click Check the connection, then Save Settings.
The Appwrite settings page in Gravity Forms: license key, endpoint, project id, API key, default database id and a Check the connection button showing the connected database
The settings page: endpoint, project id, API key, default database id and the connection result.

Check the connection uses the saved values. It reads the database once with GET /databases/{databaseId}, so it validates the endpoint, the project id, the API key and the database id without storing anything. A good result reads “Connected to Appwrite at this endpoint, project and database. Nothing was stored.” A wrong key reads “Appwrite did not accept the project id or API key”, and a missing database reads “Appwrite could not find the database”.

The API key field is a password field. After saving, the key is encrypted with libsodium (or AES-256-GCM) using a secret derived from the WordPress salts of your site, and it is never shown again or written to a log. Leave the box empty to keep the stored key, or tick Remove the stored API key to clear it.

Create a feed

Open a form, go to Settings → Appwrite and click Add New. A form can have several feeds, for example one that writes bookings to one collection and one that writes newsletter sign-ups to another, each with its own condition.

The Appwrite feed settings in Gravity Forms: feed name, collection id, database id, the attribute to field map and the condition
A feed: the collection id, an optional database override and the attribute-to-field map.
  • Feed name (required): a label for your own reference.
  • Collection id (required): the id of the collection this feed writes a document to.
  • Database id: leave it empty to use the global default database, or set it when this feed writes to a different database.
  • Attributes: the heart of the feed. Each row maps one attribute key (on the left, matching the attribute in your collection exactly) to a form field or a custom value you type (on the right). Merge tags work in a custom value, so you can combine fields, for example Gravity Forms {entry_id}.
  • Condition: standard Gravity Forms conditional logic. The document is created only when the rule matches.

Make sure each attribute key you map already exists in the collection and that the value fits its type; Appwrite refuses a document with an unknown attribute or a value that does not match. Checkboxes and multi-value fields are joined into a comma-separated string, which suits a string attribute.

What happens on submit

A front-end Gravity Form for a booking request with name, plan, mobile and email fields
A booking form on the site. Each answer maps to an attribute of the collection.
  1. The visitor sees your normal confirmation. Appwrite is never mentioned to them, and a slow or failing Appwrite never blocks the form.
  2. The add-on builds the document from your attribute map, replacing merge tags, and gives it a fresh unique document id.
  3. It creates the document with POST /databases/{databaseId}/collections/{collectionId}/documents, authenticated with the X-Appwrite-Project and X-Appwrite-Key headers.
  4. The entry receives a note such as “Appwrite (Save booking): document 65b1f2 created in collection entries, 4 attribute(s)”, and the document id and status are stored on the entry.
A Gravity Forms entry screen with the field values and an Appwrite box confirming the document was created, with the document id
The entry keeps a note and an Appwrite box with the status, collection and document id.

Merge tags and notifications

Two merge tags carry the result into your notifications and confirmations: {aw_doc_id} and {aw_status}. They appear in the merge tag list of every notification, and each accepts an optional feed id, such as {aw_doc_id_7}, when a form has several feeds.

The add-on also adds two notification events to the form: Appwrite: the document was created and Appwrite: the document could not be created. Choose one in the Event setting of a notification. A “could not be created” notification to your team is a simple safety net: if the API key was rotated or a collection was renamed, someone hears about it at once.

A failed call never blocks the submission

The create call is short and fully guarded. If Appwrite is slow, unreachable or refuses the document, the submission still completes, the visitor still sees your confirmation, and the entry simply carries a note explaining what happened. A timeout is treated carefully: because the document may have been created even though no answer came back, the add-on marks the entry as “unsure” and does not repeat the call on its own, so you never get a duplicate document without checking first. Each document is also created with its own unique id.

Change the document with a filter

Developers can adjust the document just before it is created with the gform_appwrite_document filter. Return the data array to add or change an attribute, or return a non-array to skip the document for that entry. Form-specific and feed-specific variants are supported, as with other Gravity Forms filters.

Security and privacy

The API key is encrypted at rest with a secret derived from your WordPress salts, so a copied database alone cannot read it, and it is never shown again after saving and never written to a note or a log. Every request is locked to the exact host of the endpoint you entered and never follows a redirect, so the key can only ever reach your own Appwrite. No form data is sent to GravityExtra; it goes only to the Appwrite server you configure, which you run on Appwrite Cloud or self-host, under your own terms.

Troubleshooting

  • “did not accept the API key”: check the project id and the API key, and that the key has the documents write scope on this project.
  • “could not find the database or collection”: check the database id and the collection id, and the endpoint (it must end in /v1).
  • “refused the document as invalid”: an attribute key does not exist in the collection, or a value does not match its type or size. Match the keys and types, or add the attribute in Appwrite.
  • Nothing happens: confirm the feed condition matches, the license is active, and the collection id is set.

Frequently asked questions

Does it work with self-hosted Appwrite? Yes. Enter your own endpoint ending in /v1. Appwrite Cloud and self-hosted work exactly the same way.

Can one form write to two collections? Yes. Add a feed for each collection, each with its own attribute map and condition.

Do I need to create the attributes first? Yes. Create the attributes in your collection, then map the form fields to those attribute keys. Appwrite refuses a document with an unknown attribute.

Where is my API key stored? Encrypted in your WordPress database, using a secret derived from your site salts. It is never shown again and never sent anywhere except your endpoint.

What about file uploads? This add-on writes documents to the Databases API. A file field is stored as its value (such as the file URL) in the attribute you map; it does not upload the file to Appwrite Storage.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr