← You Need a Budget + Data Stores integrations

List keys with Data Stores API on New or Updated Transaction from You Need a Budget API

Pipedream makes it easy to connect APIs for Data Stores, You Need a Budget and 1000+ other apps remarkably fast.

Trigger workflow on
New or Updated Transaction from the You Need a Budget API
Next, do this
List keys with the Data Stores API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜

Trusted by 500,000+ developers from startups to Fortune 500 companies

Adyen logo
Brex logo
Carta logo
Checkr logo
Chameleon logo
DevRev logo
LinkedIn logo
Netflix logo
New Relic logo
OnDeck logo
Replicated logo
Scale AI logo
Teamwork logo
Warner Bros. logo
Xendit logo

Developers Pipedream

Getting Started

This integration creates a workflow with a You Need a Budget trigger and Data Stores action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New or Updated Transaction trigger
    1. Connect your You Need a Budget account
    2. Configure timer
    3. Select a Budget ID
    4. Optional- Configure Since Date
  3. Configure the List keys action
    1. Connect your Data Stores account
    2. Configure Data Store
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, source-available components from Pipedream's GitHub repo. These components are 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.

Trigger

Description:Emit new event for every new or updated transaction. [See the docs](https://api.youneedabudget.com/v1#/Transactions/getTransactions)
Version:0.0.2
Key:you_need_a_budget-new-or-updated-transaction

You Need a Budget Overview

The You Need a Budget (YNAB) API provides APIs to interact with YNAB users’
budgets, transactions, and more. With the YNAB API, developers have the ability
to build applications that are tailored to an individual's budget and financial
lifestyle.

Whether you're looking to create an app to assist with budgeting and tracking
expenses, generating reports, or getting a real-time view of an individual's
budget and movements, the YNAB API provides the tools to do it. The YNAB API is
easy to use, secure, and versatile.

Here are some examples of how you can use the YNAB API:

  • Build an application to track expenses and generate reports
  • Monitor the balances of multiple budgets
  • Generate a budget snapshot based on accounts
  • Create custom visualizations and analytics tools
  • Create notifications when specific budget values change
  • Automate budgeting tasks, such as transfers and payments between accounts
  • Create interactive dashboards and track real-time trends
  • Enforce budgeting rules, such as threshold limits or budget goal tracking

Trigger Code

import common from "../common/common.mjs";

export default {
  ...common,
  key: "you_need_a_budget-new-or-updated-transaction",
  name: "New or Updated Transaction",
  description: "Emit new event for every new or updated transaction. [See the docs](https://api.youneedabudget.com/v1#/Transactions/getTransactions)",
  version: "0.0.2",
  type: "source",
  props: {
    ...common.props,
    budgetId: {
      propDefinition: [
        common.props.app,
        "budgetId",
      ],
      withLabel: true,
    },
    sinceDate: {
      propDefinition: [
        common.props.app,
        "date",
      ],
      label: "Since Date",
      optional: true,
    },
  },
  methods: {
    ...common.methods,
    generateMeta(event, isUpdate = false) {
      const {
        id,
        date,
        amount,
      } = event;
      const spent = this.app.convertFromMilliunit(amount);
      const ts = Date.parse(date);
      const summary = isUpdate
        ? `Updated transaction in ${this.budgetId.label}: ${spent}`
        : `New transaction in ${this.budgetId.label}: ${spent}`;
      return {
        id,
        summary,
        ts,
      };
    },
  },
  async run() {
    const lastKnowledgeOfServer = this.getLastKnowledgeOfServer();
    const emittedTransactions = this.getEmittedTransactions();

    const {
      server_knowledge: serverKnowledge,
      transactions = [],
    } = await this.app.getTransactions({
      budgetId: this.budgetId.value,
      sinceDate: this.sinceDate || undefined,
      lastKnowledgeOfServer,
    });

    this.setLastKnowledgeOfServer(serverKnowledge);

    for (const transaction of transactions) {
      let isUpdate;
      if (emittedTransactions[transaction.id]) {
        isUpdate = true;
      } else {
        emittedTransactions[transaction.id] = true;
      }
      const meta = this.generateMeta(transaction, isUpdate);
      this.$emit(transaction, meta);
    }

    this.setEmittedTransactions(emittedTransactions);
  },
};

Trigger 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
You Need a BudgetappappThis component uses the You Need a Budget app.
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
timer$.interface.timer
Budget IDbudgetIdstringSelect a value from the drop down menu.
Since DatesinceDatestring

E.g. 2021-11-29

Trigger Authentication

You Need a Budget uses OAuth authentication. When you connect your You Need a Budget account, Pipedream will open a popup window where you can sign into You Need a Budget and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any You Need a Budget API.

Pipedream requests the following authorization scopes when you connect your account:

About You Need a Budget

Money doesn’t have to be messy. The YNAB budgeting app and its simple four-rule method will help you organize your finances, demolish your debt, save piles of cash, and reach your financial goals faster.

Action

Description:List all keys in your [Pipedream Data Store](https://pipedream.com/data-stores/).
Version:0.0.1
Key:data_stores-list-keys

Data Stores Overview

With the Data Stores API, you can build applications that:

  • Store data for later retrieval
  • Retrieve data from a store
  • Update data in a store
  • Delete data from a store

Action Code

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

export default {
  key: "data_stores-list-keys",
  name: "List keys",
  description: "List all keys in your [Pipedream Data Store](https://pipedream.com/data-stores/).",
  version: "0.0.1",
  type: "action",
  props: {
    app,
    dataStore: {
      propDefinition: [
        app,
        "dataStore",
      ],
    },
  },
  async run ({ $ }) {
    const keys = await this.dataStore.keys();
    if (keys.length > 0) {
      $.export("$summary", `Found ${keys.length} key(s).`);
    } else {
      $.export("$summary", "No keys found.");
    }
    return keys;
  },
};

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
Data StoresappappThis component uses the Data Stores app.
Data StoredataStoredata_store

Select an existing Data Store or create a new one.

Action Authentication

The Data Stores API does not require authentication.

About Data Stores

Use Pipedream Data Stores to manage state throughout your workflows.

More Ways to Connect Data Stores + You Need a Budget

Delete All Records with Data Stores API on Category Overspent from You Need a Budget API
You Need a Budget + Data Stores
 
Try it
List keys with Data Stores API on Category Overspent from You Need a Budget API
You Need a Budget + Data Stores
 
Try it
Delete All Records with Data Stores API on Low Account Balance from You Need a Budget API
You Need a Budget + Data Stores
 
Try it
List keys with Data Stores API on Low Account Balance from You Need a Budget API
You Need a Budget + Data Stores
 
Try it
Delete All Records with Data Stores API on New or Updated Transaction from You Need a Budget API
You Need a Budget + Data Stores
 
Try it
Category Overspent from the You Need a Budget API

Emit new event when a category budget is overspent

 
Try it
Low Account Balance from the You Need a Budget API

Emit new event when an account balance drops below a certain amount

 
Try it
Low Category Balance from the You Need a Budget API

Emit new event when a category balance drops below a certain amount

 
Try it
New or Updated Transaction from the You Need a Budget API

Emit new event for every new or updated transaction. See the docs

 
Try it
New Spending In Account from the You Need a Budget API

Emit new event for every spending in an account. See the docs

 
Try it
Create Transaction with the You Need a Budget API

Creates a single transaction. See the docs

 
Try it
Update Category Budget with the You Need a Budget API

Update a category budget for a specific month. See the docs

 
Try it
Add or update a single record with the Data Stores API

Add or update a single record in your Pipedream Data Store.

 
Try it
Add or update multiple records with the Data Stores API

Add or update multiple records to your Pipedream Data Store.

 
Try it
Append to record with the Data Stores API

Append to a record in your data store Pipedream Data Store. If the record does not exist, a new record will be created in an array format.

 
Try it