← Fauna + Dropbox integrations

List All Files/Subfolders in a Folder with Dropbox API on New or Removed Documents in a Collection from Fauna API

Pipedream makes it easy to connect APIs for Dropbox, Fauna and 2,500+ other apps remarkably fast.

Trigger workflow on
New or Removed Documents in a Collection from the Fauna API
Next, do this
List All Files/Subfolders in a Folder with the Dropbox API
No credit card required
Intro to Pipedream
Watch us build a workflow
Watch us build a workflow
8 min
Watch now ➜

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

Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo
Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo

Developers Pipedream

Getting Started

This integration creates a workflow with a Fauna trigger and Dropbox 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 Removed Documents in a Collection trigger
    1. Configure timer
    2. Connect your Fauna account
    3. Select a Collection
    4. Optional- Configure Emit changes as a single event
  3. Configure the List All Files/Subfolders in a Folder action
    1. Connect your Dropbox account
    2. Select a Path
    3. Configure Recursive
    4. Configure Include Deleted
    5. Configure Include has explicit shared members
    6. Configure Include mounted folders
    7. Configure Include non downloadable files
    8. Optional- Configure Limit
  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 each time you add or remove a document from a specific collection, with the details of the document.
Version:0.0.8
Key:faunadb-changes-to-collection

Fauna Overview

Fauna API offers a powerful serverless database solution for modern applications. Its unique capabilities allow for highly scalable, secure, and flexible data management. With Pipedream, you can harness the power of Fauna to create intricate serverless workflows that react to various triggers, manage data efficiently, and connect seamlessly with other services and APIs to automate complex tasks.

Trigger Code

import fauna from "../../faunadb.app.mjs";
import _ from "lodash";
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";

export default {
  type: "source",
  key: "faunadb-changes-to-collection",
  name: "New or Removed Documents in a Collection",
  description: "Emit new event each time you add or remove a document from a specific collection, with the details of the document.",
  version: "0.0.8",
  dedupe: "unique", // Dedupe events based on the concatenation of event + document ref id
  props: {
    timer: {
      type: "$.interface.timer",
      default: {
        intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
      },
    },
    db: "$.service.db",
    fauna,
    collection: {
      propDefinition: [
        fauna,
        "collections",
      ],
    },
    emitEventsInBatch: {
      type: "boolean",
      label: "Emit changes as a single event",
      description:
        "If `true`, all events are emitted as an array, within a single Pipedream event. Defaults to `false`, emitting each event in Fauna as its own event in Pipedream",
      optional: true,
      default: false,
    },
  },
  async run() {
    // As soon as the script runs, mark the start time so we can fetch changes
    // since this time on the next run. Fauna expects epoch ms as its cursor.
    const ts = +new Date() * 1000;
    const cursor = this.db.get("cursor") || ts;

    const events = await this.fauna.getEventsInCollectionAfterTs(
      this.collection,
      cursor,
    );

    if (!events.length) {
      console.log(`No new events in collection ${this.collection}`);
      this.db.set("cursor", ts);
      return;
    }

    console.log(`${events.length} new events in collection ${this.collection}`);

    // Batched emits do not take advantage of the built-in deduper
    if (this.emitEventsInBatch) {
      this.$emit({
        events,
      }, {
        summary: `${events.length} new event${events.length > 1
          ? "s"
          : ""}`,
        id: cursor,
      });
    } else {
      for (const event of events) {
        this.$emit(event, {
          summary: `${event.action.toUpperCase()} - ${event.document.id}`,
          id: `${event.action}-${event.document.id}`, // dedupes events based on this ID
        });
      }
    }

    // Finally, set cursor for the next run to the max timestamp of the changed events, ensuring we
    // get all events after that on the next run. We need to add 1 since the timestamp filter in
    // Fauna is inclusive: https://docs.fauna.com/fauna/current/api/fql/functions/paginate
    const maxEventTs = _.maxBy(events, (event) => event.ts).ts + 1;

    this.db.set("cursor", maxEventTs);
  },
};

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
timer$.interface.timer
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
FaunafaunaappThis component uses the Fauna app.
CollectioncollectionstringSelect a value from the drop down menu.
Emit changes as a single eventemitEventsInBatchboolean

If true, all events are emitted as an array, within a single Pipedream event. Defaults to false, emitting each event in Fauna as its own event in Pipedream

Trigger Authentication

Fauna uses API keys for authentication. When you connect your Fauna account, Pipedream securely stores the keys so you can easily authenticate to Fauna APIs in both code and no-code steps.

Create a key in the Security section of your FaunaDB dashboard, then enter the Secret below.

Read more about Keys and Fauna Security

About Fauna

The distributed serverless database combining the flexibility of NoSQL with the relational querying capabilities of SQL systems.

Action

Description:Retrieves a list of files or subfolders in a specified folder [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesListFolder__anchor)
Version:0.0.10
Key:dropbox-list-file-folders-in-a-folder

Dropbox Overview

The Dropbox API on Pipedream enables you to automate file and folder operations, streamlining workflows that involve storing, syncing, and sharing content. With this API, you can programmatically manage files, set up event-driven triggers based on changes within Dropbox, and leverage Pipedream's capabilities to connect with hundreds of other apps for extended automation scenarios. It's ideal for building custom file management solutions, archiving systems, or collaborative content workflows without writing extensive code.

Action Code

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

export default {
  name: "List All Files/Subfolders in a Folder",
  description: "Retrieves a list of files or subfolders in a specified folder [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesListFolder__anchor)",
  key: "dropbox-list-file-folders-in-a-folder",
  version: "0.0.10",
  type: "action",
  props: {
    dropbox,
    path: {
      propDefinition: [
        dropbox,
        "path",
        () => ({
          initialOptions: [],
          filter: ({ metadata: { metadata: { [".tag"]: type } } }) => type === "folder",
        }),
      ],
      description: "Type the folder name to search for it in the user's Dropbox.",
    },
    recursive: {
      type: "boolean",
      label: "Recursive",
      description: "If `true`, the list folder operation will be applied recursively to all subfolders and the response will contain contents of all subfolders.",
      default: true,
    },
    includeDeleted: {
      type: "boolean",
      label: "Include Deleted",
      description: "If `true`, the results will include files and folders that used to exist but were deleted.",
      default: false,
    },
    includeHasExplicitSharedMembers: {
      type: "boolean",
      label: "Include has explicit shared members",
      description: "If `true`, the results will include a flag for each file indicating whether or not that file has any explicit members.",
      default: false,
    },
    includeMountedFolders: {
      type: "boolean",
      label: "Include mounted folders",
      description: "If `true`, the results will include entries under mounted folders which includes app folder, shared folder and team folder.",
      default: false,
    },
    includeNonDownloadableFiles: {
      type: "boolean",
      label: "Include non downloadable files",
      description: "If `true`, include files that are not downloadable, i.e. Google Docs.",
      default: true,
    },
    limit: {
      propDefinition: [
        dropbox,
        "limit",
      ],
    },
  },
  async run({ $ }) {
    const {
      limit,
      path,
      recursive,
      includeDeleted,
      includeHasExplicitSharedMembers,
      includeMountedFolders,
      includeNonDownloadableFiles,
    } = this;
    const res = await this.dropbox.listFilesFolders({
      path: this.dropbox.getPath(path),
      recursive,
      include_deleted: includeDeleted,
      include_has_explicit_shared_members: includeHasExplicitSharedMembers,
      include_mounted_folders: includeMountedFolders,
      include_non_downloadable_files: includeNonDownloadableFiles,
    }, limit);
    $.export("$summary", `Files and folders in the path ${path?.label || path} successfully fetched`);
    return res;
  },
};

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
DropboxdropboxappThis component uses the Dropbox app.
PathpathstringSelect a value from the drop down menu.
Recursiverecursiveboolean

If true, the list folder operation will be applied recursively to all subfolders and the response will contain contents of all subfolders.

Include DeletedincludeDeletedboolean

If true, the results will include files and folders that used to exist but were deleted.

Include has explicit shared membersincludeHasExplicitSharedMembersboolean

If true, the results will include a flag for each file indicating whether or not that file has any explicit members.

Include mounted foldersincludeMountedFoldersboolean

If true, the results will include entries under mounted folders which includes app folder, shared folder and team folder.

Include non downloadable filesincludeNonDownloadableFilesboolean

If true, include files that are not downloadable, i.e. Google Docs.

Limitlimitinteger

Specify a max amount of register to be fetched. Defaults to 100 if left blank.

Action Authentication

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

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

About Dropbox

Dropbox gives you secure access to all your files. Collaborate with friends, family, and coworkers from any device.

More Ways to Connect Dropbox + Fauna

Read From FaunaDB Collection with Fauna API on New or Modified File or Folder from Dropbox API
Dropbox + Fauna
 
Try it
Read From FaunaDB Collection with Fauna API on New File from Dropbox API
Dropbox + Fauna
 
Try it
Read From FaunaDB Collection with Fauna API on New Folder from Dropbox API
Dropbox + Fauna
 
Try it
Read From FaunaDB Collection with Fauna API on New or Modified File or Folder from Dropbox API
Dropbox + Fauna
 
Try it
Execute GraphQL Query with Fauna API on New or Modified File or Folder from Dropbox API
Dropbox + Fauna
 
Try it
New or Removed Documents in a Collection from the Fauna API

Emit new event each time you add or remove a document from a specific collection, with the details of the document.

 
Try it
New File from the Dropbox API

Emit new event when a new file is added to your account or a specific folder. Make sure the number of files/folders in the watched folder does not exceed 4000.

 
Try it
New Folder from the Dropbox API

Emit new event when a new folder is created. Make sure the number of files/folders in the watched folder does not exceed 4000.

 
Try it
New or Modified File or Folder from the Dropbox API

Emit new event when a file or folder is added or modified. Make sure the number of files/folders in the watched folder does not exceed 4000.

 
Try it
Execute GraphQL Query with the Fauna API

Performs an arbitrary authorized GraphQL query. See docs here

 
Try it
Import GraphQL schema with the Fauna API

Import graphQL schema to a database. See docs here

 
Try it
Read From Fauna Collection with the Fauna API

Reads all documents from a given Fauna collection. See docs here

 
Try it
Create a Text File with the Dropbox API

Creates a brand new text file from plain text content you specify. See the documentation

 
Try it
Create folder with the Dropbox API

Create a Folder. See the documentation

 
Try it

Explore Other Apps

1
-
24
of
2,500+
apps by most popular

HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
Node
Node
Anything you can do with Node.js, you can do in a Pipedream workflow. This includes using most of npm's 400,000+ packages.
Python
Python
Anything you can do in Python can be done in a Pipedream Workflow. This includes using any of the 350,000+ PyPi packages available in your Python powered workflows.
Pipedream Utils
Pipedream Utils
Utility functions to use within your Pipedream workflows
OpenAI (ChatGPT)
OpenAI (ChatGPT)
OpenAI is an AI research and deployment company with the mission to ensure that artificial general intelligence benefits all of humanity. They are the makers of popular models like ChatGPT, DALL-E, and Whisper.
Premium
Salesforce
Salesforce
Cloud-based customer relationship management (CRM) platform that helps businesses manage sales, marketing, customer support, and other business activities, ultimately aiming to improve customer relationships and streamline operations.
Premium
HubSpot
HubSpot
HubSpot's CRM platform contains the marketing, sales, service, operations, and website-building software you need to grow your business.
Premium
Zoho CRM
Zoho CRM
Zoho CRM is an online Sales CRM software that manages your sales, marketing, and support in one CRM platform.
Premium
Stripe
Stripe
Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes.
Shopify
Shopify
Shopify is a complete commerce platform that lets anyone start, manage, and grow a business. You can use Shopify to build an online store, manage sales, market to customers, and accept payments in digital and physical locations.
Premium
WooCommerce
WooCommerce
WooCommerce is the open-source ecommerce platform for WordPress.
Premium
Snowflake
Snowflake
A data warehouse built for the cloud
Premium
MongoDB
MongoDB
MongoDB is an open source NoSQL database management program.
Supabase
Supabase
Supabase is an open source Firebase alternative.
MySQL
MySQL
MySQL is an open-source relational database management system.
PostgreSQL
PostgreSQL
PostgreSQL is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
Premium
AWS
AWS
Amazon Web Services (AWS) offers reliable, scalable, and inexpensive cloud computing services.
Premium
Twilio SendGrid
Twilio SendGrid
Send marketing and transactional email through the Twilio SendGrid platform with the Email API, proprietary mail transfer agent, and infrastructure for scalable delivery.
Amazon SES
Amazon SES
Amazon SES is a cloud-based email service provider that can integrate into any application for high volume email automation
Premium
Klaviyo
Klaviyo
Email Marketing and SMS Marketing Platform
Premium
Zendesk
Zendesk
Zendesk is award-winning customer service software trusted by 200K+ customers. Make customers happy via text, mobile, phone, email, live chat, social media.
Premium
ServiceNow
ServiceNow
The smarter way to workflow
Notion
Notion
Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team.
Slack
Slack
Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.