🎉 Pipedream raises $20M Series A 🎉
Read the blog post and TC Techcrunch article.
← Data Stores

Add or update a single record with Data Stores API

Pipedream makes it easy to connect APIs for Data Stores and 700+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Add or update a single record with the Data Stores API
No credit card required
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Add or update a single record with the Data Stores API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Add or update a single record action
    1. Connect your Data Stores account
    2. Configure Data Store
    3. Select a Key
    4. Configure Value
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Add or update a single record on Data Stores
Description:Add or update a single record in your [Pipedream Data Store](https://pipedream.com/data-stores/).
Version:0.0.5
Key:data_stores-add-update-record

Code

import app from "../../data_stores.app.mjs";

export default {
  key: "data_stores-add-update-record",
  name: "Add or update a single record",
  description: "Add or update a single record in your [Pipedream Data Store](https://pipedream.com/data-stores/).",
  version: "0.0.5",
  type: "action",
  props: {
    app,
    dataStore: {
      propDefinition: [
        app,
        "dataStore",
      ],
    },
    key: {
      propDefinition: [
        app,
        "key",
        ({ dataStore }) => ({
          dataStore,
        }),
      ],
    },
    value: {
      label: "Value",
      type: "any",
      description: "Enter a string, object, or array.",
    },
  },
  async run({ $ }) {
    const {
      key,
      value,
    } = this;
    const record = await this.dataStore.get(key);
    let parsedValue;
    if (typeof value !== "string") {
      parsedValue = value;
    } else {
      try {
        let json = this.app.sanitizeJson(value);
        parsedValue = JSON.parse(json);
      } catch (err) {
        parsedValue = value;
      }
    }
    await this.dataStore.set(key, parsedValue);
    // eslint-disable-next-line multiline-ternary
    $.export("$summary", `Successfully ${record ? "updated the record for" : "added a new record with the"} key, \`${key}\`.`);
    return {
      key,
      value,
    };
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
Data StoresappappThis component uses the Data Stores app.
Data StoredataStoredata_store

Select an existing Data Store or create a new one.

KeykeystringSelect a value from the drop down menu.
Valuevalueany

Enter a string, object, or array.

Authentication

The Data Stores API does not require authentication.

About Data Stores

Use Pipedream Data Stores to manage state throughout your workflows.

About Pipedream

Stop writing boilerplate code, struggling with authentication and managing infrastructure. Start connecting APIs with code-level control when you need it — and no code when you don't.

Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
"The past few weeks, I truly feel like the clichéd 10x engineer."
@heyellieday