deplyr
Log Indeplyr.com
  • Welcome
  • How-to Guides
    • Use AI in actions
    • Use App Data Storage
    • Use App Requirements Doc
  • Use App Versions
  • Use Realtime App Logger
  • Share Your Apps
  • Integrations
    • Using Google Sheets for Apps
    • Using Airtable for Apps
    • Using the Xero Integration
Powered by GitBook
On this page
  • Purpose
  • Usage Examples
  • Prompting Tips
  1. How-to Guides

Use App Data Storage

Learn how to use App Data Storage.

Purpose

We can use have a built in key-value storage to store basic state between action runs or to help us centralize values we need across actions, like IDs. Note that key-value storage items are always stored as strings, so you may have to cast the type.

Usage Examples

We can store our Airtable base ID, Google Sheets ID, or any other ID inkey-value storage so that we don’t have to copy/paste it into our actions. If we change the ID, we just change it in one location. You can set a key-value pair in the “App Data Storage” tab, then call it in your action with the following code:

const base_id = kv.get("AIRTABLE_BASE_ID") // Returns the item from key-value storage

You can also set values in key-value storage. If the value does not exist in key-value storage then it will be created the first time the code is run. For example:

kv.set("highScore", 500) // This will update "highScore" to "500" (string value)

Prompting Tips

When you want our AI to generate code for you with key-value storage, mention that you want to use key-value storage like this:

Use key-value storage to fetch the Airtable base ID. I called it AIRTABLE_BASE_ID.

PreviousUse AI in actionsNextUse App Requirements Doc

Last updated 2 months ago