Showing Active Stripe Members in Table

Hey guys!

Currently working on a Retool app that is integrated with my Stripe account.

I have a table that is displaying all my stripe customers who have active subscriptions.

Is there a way that I can add a column to my current table that displays if a customer has an active subscription or not?

Basically, I have my "get" customers query, and my "get" subscription query, but I would like to have a separate query that joins these two queries, and connects the customer to a subscription.

That way, my table will list customers and have a column that shows if that customer has an active subscription or not.

How can I accomplish this?

Thanks in advance.

@andrewl123 What resource type are you using? mysql, postgres, etc...?

Hey Scott, thanks for the reply.

I'm currently using the Stripe Integration resource type.

My main question is just to see if this kind of thing is even possible. I know if I had my Stripe data in a postgre sql database, I could accomplish this, but I'm not sure if it's possible with a boilerplate Stripe integration query.

Have you looked at the Stripe API?
I am wondering if you could simply make one call getting all customer information?
But, if not.....
You will probably have to loop through that customer list to get each customer ID

  for (let i = 0; i < YourCustomerListQuery.length; i++) {
    await getEachCustomerSubscriptionStatus({ additionalScope: {
customerSubStatus:customerListQuery.[i].value
} })
  }

Your getEachCustomerSubscriptionStatus query will call
could call

GET
/v1/subscriptions/:id (id would be replaced with {{customerSubStatus}} in the Stripe call
found here: Stripe API reference – Subscriptions – curl

More on status here

Also, check out how to use additionalScope
https://docs.retool.com/docs/scripting-retool#triggering-a-query

Update: Turns out I can just use the [expand] functionality to access the Stripe subscriptions for the user table