Import only recent from Bubble

Hello! I’m importing data from the Bubble API to compare to data in a google sheet. This flow is meant to find overlap and remove any rows containing the same order ID, so as to only send new orders to my Bubble app. Everything is set up well with the workflow, but the problem is that my Bubble get request seems to start from the first order in the DB and work its way to the set limit. It seems like I can expand how many orders it pulls, but I’m wondering if there is any way to filter it such that the get request only returns entries that were created in the last 24 hours. Any suggestions would be appreciated!

Hi @Aidan_Fitzgerald :wave:

Welcome to the community!

Taking a look a Bubble’s documentation, you can use a Search Constraint directly in your API Endpoint URL to filter the data returned by their API.

To do this, you’ll need to define the key (field) that you want to search on, the constraint type, and the search value.

In your case, your key will likely be Created Date or something similar. Your constraint type will be greater than, and your search value will be a dynamical date variable from the last 24 hours.

Your final endpoint might look like this:
https://appname.bubbleapps.io/api/1.1/obj/typename?api_token=12345&constraints=[%7B"key":"Created Date","constraint_type":"greater than","value":"{CurrentDateTime}”%7D]

To dynamically create a date value, I recommend using these steps together:

  1. Start with date and time column: Set the Days Offset value to -1
  2. Format Dates: Format as YYYY-MM-DD
  3. Enrich with an API: This will contain your the API call from above

Let me know if that helps!

Thank you! It wound up being easier to use “sort by” with descending being true, but this pointed me in the right direction.

1 Like