Apply workflow to entire database

Hi Everyone,

I am looking for help on how to apply an API workflow across an entire database. Specifically, I would like to know how to set up the workflow to do this.

Some context/details of my project:

I have a database called UserWallets. When users sign up to my webapp they submit their wallet addresses. Each time a wallet is submitted, it is entered as a new item in the UserWallet database.

The variables in the database as as follows:

  1. User: The email address of the current user

  2. WalletAddress: The crypto wallet address entered by a user upon signup. There can be multiple for a given user.

  3. ListOfCollectionIDs: A list of unique IDs pertaining to the assets in a given wallet. These are pulled from an API workflow that I have set up called “Scrape”. Every time a user creates an entry in the UserWallet database, the API workflow looks up the value in the “WalletAddress” variable, searches for its contents in an external database, then populates the list in Bubble accordingly.

The workflow I have set up to add UserWallet entries and populate the ListOfCollectionIDs is as follows:

When “Button Submit” is clicked…

  1. Create a new UserWallet
    Type: UserWallet
    Field #1: WalletAddress = InputBox#1’s Value
    Field #2: User = CurrentUser

  2. Make changes to UserWallet
    Thing to change: Result of Step 1
    Field #1: ListOfCollectionIDs set list Scrape [This is the API worflow I taked about above] (Path: This UserWallet’s WalletAddress):each item’s id

I’m able to successfully apply my API workflow in the above example because I am able to direct it to “The Result of Step 1” and, therefore, specify the exact UserWallet item.

I would like to know how to apply this API workflow either on demand, or periodically, to every entry in my UserWallet database. How should I set up the workflow to do this?

Thanks so much in advance, this has been driving me nuts!!

Seems to me you would need a backend workflow that takes a list of UserWallets and loops through them. You could pass a list with a single UserWallet to allow for a User to update there own account, or run this on a schedule and pass in a list of all active UserWallets.

Hi @unjumble
You will be able to do this with a recursive workflow that runs and once complete auto-schedules itself for a future date so it runs again.

I can help show you how to set these up. Please DM me if you want some help.


This topic was automatically closed after 70 days. New replies are no longer allowed.