Introduction to Pipes
What are Pipes?
Pipes is an all-powerful, built-in integration system that enables you to access and trigger external APIs from within your Tadabase app. You can use pipes to merge your data in Tadabase with external data from thousands of your favorite services, dynamically pulling any outside data you need into your Tadabase app and creating just about any workflow and connection imaginable.
If you prefer to learn in a structured academy course, please check out the Pipes Academy:
Here are a few practical examples of what you can do with Pipes:
💭 Think of Pipes as a more powerful and built in Zapier
Here are some of the following ways you can use pipes:
- Dynamically load external data within components to merge with internal data
- Dynamically load form values with externally retrieved data
- Update and insert database values behind the scenes using returned values from an API
- Validate forms before submission against any external data
- Auto-route users to where you want them to go using ingested data and logged-in user values
How Pipes work
TLDR:
Pipes work by intercepting an action that happens in your app, utilizing the pipe, and getting back a response. The value of the response can be utilized in different ways depending on what triggered the pipe.
Analogy:
Think of Pipes as a smart mailman. When you drop a letter into the mailbox (an action happens in your app), the smart mailman (the Pipe) picks it up, reads the address, and delivers it to the correct recipient. The recipient then sends back a reply (the value of the response), and the smart mailman delivers this reply back to you. Depending on the content of the reply, you might take different actions, just like how the app utilizes the response in different ways.
Here's a simplified illustration to demonstrate this:
The illustration above is assuming we're using a Pipe when adding or editing a record. We'll now look at the use cases of when you can use a Pipe throughout your app.
Use cases
- Merge external data in a table component
- Dynamically load external data into forms
- Validate values based on external data
- Update records dynamically when records are saved
- Direct users based on external pipe data
- Show custom data based on external pipes
We'll briefly discuss each of these Pipes use cases below, as well as further explore each within its own article to come.
Merge external data into tables
Generally, table components display data from a selected data table within Tadabase. With Pipes, however, you can pull data from any external source and merge it into the table component within Tadabase when the table loads. In this way, you can provide users with the full picture of data, merging both internal and external data within one table component that users can process at a glance.
To illustrate this, let's go back to our basic example of a simple Weather Pipe.
The following table component shows a list of cities which are pulled from the Cities data table within Tadabase.
With Pipes, you can add external data to this table component, such as the current temperature and weather description for each city. This weather information is not stored in Tadabase, rather it is dynamically retrieved from an external weather source using a pipe and dynamically loaded into the table component as new columns.
Load external data into forms
With Pipes, you can also dynamically populate forms with externally retrieved data.
For instance, if you want to automatically gather information on a vehicle based on a VIN number, you can use a pipe to retrieve the vehicle information from an external source and systematically populate the correct form fields with the values returned in the pipe when the VIN number is entered. As you can see in the gif below, when users enter their VIN numbers within the Vehicle Information form, their vehicle information will be automatically retrieved and populated within the form.
Validate against external data
You can also use Pipes to validate data against pipe values to prevent forms from being submitted when specific conditions are met.
For instance, a moving company can ask users for their Moving From and Moving To locations. With a Pipe, the total distance between the two provided locations can be automatically referenced from an external source and validated against a maximum distance that you predefine. If the distance exceeds the predefined maximum distance allowed, show a custom error message and prevent the form from being submitted.
Update records based on Pipes
You can also use Pipes to update records based on external values returned in the pipe. The values returned in the pipe will be saved statically into the database.
For instance, when a user saves a URL in the database, a Pipe can automatically update the URL to a shortened URL and save that shortened URL to the database in place of the original URL value entered by the user.
Auto-route users based on Pipes
You can also use Pipes to direct users based on external values as well as logged-in user values.
For instance, you can trigger a Pipe to run every time a page loads to check the logged-in user's email address and check Stripe to see if the logged-in user's Stripe subscription is active. If the logged-in user's Stripe account is active, auto-route that user to the Dashboard page. If the logged-in user's Stripe account is inactive, show a custom error message saying that the user is not authorized to visit this specific page.
Show custom data based on Pipes
You can also use Pipes to show custom data inside any HTML component based on values returned in the Pipe.
For instance, when users login to the app, show the current weather for their current locations.
What's Next?
We'd love to hear your feedback.