One nice feature of SuperSaaS is the credit system, which allows end-users to buy credit once and then easily pay for appointments without needing to go through the entire payment process each time. There are multiple things that can affect a credit balance. Credit purchases and new appointments, obviously, but also refunds due to canceled appointments, and manual credit adjustments by a superuser.
It can sometimes be useful to have a detailed look into the actions that affected a user’s credit balance, but it’s not always easy to piece together what happened from the purchase history and the appointment history. It’s in situations like these that combining services like Pipedream integrations with SuperSaaS and Google Sheets can be very handy to display a journal of all credit affecting events.
This post is a step-by-step tutorial for setting up the logging of user credit information to a Google Sheet using Pipedream, a powerful API integration service.
At the end of this tutorial, your spreadsheet will look like this:

Pipedream account and spreadsheet creation
The way Pipedream works is you create workflows, which are information flows capable of connecting multiple services, such as SuperSaaS and Google Sheets. For this particular use-case, a single workflow is enough.
The first thing that needs to be done is to create an account in SuperSaaS and on Pipedream.com. Make sure that you’re authenticated before proceeding.
Once authenticated, go to the Workflows page in your Pipedream account and click the New Workflow button to create a new workflow and then the Add Trigger button to add the trigger condition.

Connecting SuperSaaS
Next, configure the workflow trigger that will listen for SuperSaaS credit-related events.
In the search bar, type SuperSaaS and select it from the list of results. Then you’re interested in the Credit Balance Changes trigger, so click that. Now you have a workflow with a trigger, but you still need to connect your trigger to your SuperSaaS account. Click the blue Connect a SuperSaaS account to the right-side panel, enter your account name and API key.
Follow the instructions in the dialog to create the connection between your Pipedream and SuperSaaS accounts.
Obtain your SuperSaaS API key at the bottom of your Account Info page and enter in the api_key field and click the Save button.

Now select all the schedules in which your users might spend their credits. This workflow will not track credit spent on other schedules, so select all of them to make sure your spreadsheet won’t be missing any data.

Make sure to click the Save and continue button and to generate a test credit change event in SuperSaaS to test and activate the trigger.

After creating a new client with credit, after a few seconds you should see:

Click the blue Continue button to move on and add an action that happens when the trigger fires.
Adding the Google Sheets logging step
Now that the trigger is configured, you can select Google Sheets from the list of available actions. The pre-built Add Single Row is recommended.
Click the blue Connect a Google Sheets account button and follow the instructions to connect your Pipedream account to a Google Sheets account where you’ll want to store your user credit logs.
Once successfully connected, open Google Sheets and create a spreadsheet to store your credit logs. You can name it whatever you’d like; the name will show up in the Pipedream dropdown next.

Select the spreadsheet you just created from the dropdown, then the sheet/tab name in the Worksheet ID field.
Depending on whether your spreadsheet contains a header row with field names, you should select TRUE or FALSE in the next field to proceed.
In the Values field, you need to select from the data loaded from the test event each field you want to populate the new columns. A recommended setup is as follows:

This will give you a clean Created On, Event Type (New User, Credit Change, etc.), User Email, and the Credit Value.
Click the blue Test button and confirm the row was created in your spreadsheet. From now on all you need to do is click the Deploy button and your pipeline is ready to work!
Test to make sure it works!
Now that you have it all setup, make sure you create a new account, make appointments, and check your spreadsheet to see if it’s all working. After every user action, it should take less than 5 seconds for your spreadsheet update.
Use regular Google Sheets filters to check balance history for a single user over the date/time ranges you’re interested on.
Go beyond
If you’re excited about this kind of automation and service integration, maybe you want to build something else that suits your specific needs?
In that case, make sure to check out the other available SuperSaaS event sources/triggers for Pipedream:

The trigger configuration procedure will always be very similar to the Credit balance changes one we created earlier, so hopefully you feel like playing with the other options as well.
Other output integrations may not require a lot of technical knowledge, such as sending yourself emails when appointments are created or updated—free of charge.
Using SuperSaaS custom webhooks instead
If you’re using SuperSaaS triggers for Pipedream, what they’re really doing under the hood is setting up SuperSaaS webhooks against Pipedream’s HTTP/Webhook built-in triggers.
Using SuperSaaS’ premium custom webhooks feature, you can also manually do that and forward any possible SuperSaaS webhook events to your Pipedream workflows, even ones we haven’t integrated into Pipedream yet, such as the Changed form and Send mail events.
Let’s say you’d like to set up a workflow that triggers every time one of your users update a form: On your Pipedream account, click New Workflow again and select the HTTP / Webhook built-in trigger.

The default endpoint settings are OK for SuperSaaS Webhooks, click Save and continue.

Click Save and continue and copy the generated endpoint (e.g. https://example.m.pipedream.net) to the SuperSaaS custom webhooks page. Select the trigger you’re interested in (e.g. Changed form), fill in its parameters (if any, e.g. in this case, which form to track), and use your Pipedream HTTP endpoint as Target URL.

All the other existing webhooks in the screenshot were automatically created and are managed by the SuperSaaS Credit balance changes trigger we set up at the beginning of this tutorial.
You can also create multiple custom webhooks for the same Target URL if that makes sense for your particular use-case. As an example, Credit balance changes event sources require at least 3 webhooks, for example: Changed user, Credit purchase, and Changed appointment (one for each tracked schedule), and all point to the same workflow endpoint.
Once you create your custom webhook, you can click the Test webhook link, then the Post payload now button to send a test event to your workflow. You’ll be able to use this test event as a reference for setting up the rest of your workflow, as well as easily replay it from the Pipedream UI to quickly give your entire workflow a shot.


Once the payload is posted, you should soon see it in your Pipedream workflow.

With this, you’re good to add whatever Pipedream actions you see fit to be executed when your SuperSaaS account emits Changed form events for the form you’re tracking.
If you have any questions related to SuperSaaS, our support team is ready to help out.
This is a rewritten version of an article published on November 2nd, 2020