In the world of software development and data management, we often face a familiar challenge: wrangling data from multiple sources. You might have a user list from your primary database, another from a marketing event spreadsheet, and a third from a partner API. The data is messy, inconsistent, and riddled with duplicates. Manually cleaning and combining these lists is a tedious, error-prone task that drains valuable development time.
What if you could treat these complex data operations as simple, composable building blocks? What if you could build a powerful data pipeline as easily as writing a few lines of code?
Welcome to lists.do—where we provide intelligent list operations, on demand. Our simple API empowers you to programmatically merge, deduplicate, sort, and transform any list, turning chaotic data into a clean, actionable asset. This post will show you how to unlock the true power of automation by chaining multiple list operations to build an elegant and efficient data workflow.
At its core, a complex data pipeline is just a sequence of simpler tasks. The magic happens when you connect these tasks, with the output of one step becoming the input for the next. With lists.do, each of these tasks is a straightforward API call.
Here are the fundamental building blocks you can use:
By chaining these simple yet powerful actions, you can automate workflows that once required hours of manual effort or complex custom scripts.
Let's build a common pipeline: compiling a clean, unified contact list for a marketing campaign. We have two sources: our main CRM and a list of new sign-ups from a recent webinar.
Our goal is to:
First, we combine our crmContacts and webinarSignups lists. The lists.do API makes this a single call.
import { lists } from '@binaural/lists';
const crmContacts = [
{ name: 'Alice', email: 'alice@example.com' },
{ name: 'Bob', email: 'BOB@example.com' }
];
const webinarSignups = [
{ name: 'Charlie', email: 'charlie@example.com' },
{ name: 'Alice', email: 'alice@example.com' } // Duplicate
];
// Let's assume we have our lists ready for merging
const mergedListResponse = await lists('v1').merge({
lists: [crmContacts, webinarSignups]
});
// The result is a single, combined list
const mergedList = mergedListResponse.result;
// [
// { name: 'Alice', email: 'alice@example.com' },
// { name: 'Bob', email: 'BOB@example.com' },
// { name: 'Charlie', email: 'charlie@example.com' },
// { name: 'Alice', email: 'alice@example.com' }
// ]
Our merged list now contains duplicates. Manually finding them in a list of thousands would be impossible. With lists.do, we can specify the email field as the unique key for deduplication. Our AI-powered agent handles the rest.
// Taking the 'mergedList' from the previous step
const uniqueListResponse = await lists('v1').deduplicate({
items: mergedList,
key: 'email' // Tell the agent to deduplicate based on the email property
});
const uniqueList = uniqueListResponse.result;
// {
// "result": [
// { "name": "Alice", "email": "alice@example.com" },
// { "name": "Bob", "email": "BOB@example.com" },
// { "name": "Charlie", "email": "charlie@example.com" }
// ]
// }
Notice how it intelligently kept the first instance of 'Alice' and removed the second.
The true power of lists.do emerges when you compose these operations. You don't need to wait for one request to finish before making the next. You can design a single, fluid workflow that orchestrates the entire process.
Let’s combine everything—merging, deduplicating, transforming (to lowercase emails), and sorting—into a single conceptual workflow.
import { lists } from '@binaural/lists';
async function buildMasterContactList() {
const crmContacts = [/* ... */];
const webinarSignups = [/* ... */];
// 1. Merge
const { result: merged } = await lists('v1').merge({
lists: [crmContacts, webinarSignups]
});
// 2. Deduplicate
const { result: unique } = await lists('v1').deduplicate({
items: merged,
key: 'email'
});
// 3. Transform
const { result: transformed } = await lists('v1').transform({
items: unique,
// Instruct the agent to lowercase the email field for each item
instruction: "For each object, transform the 'email' property to lowercase."
});
// 4. Sort
const { result: sortedFinalList } = await lists('v1').sort({
items: transformed,
key: 'email',
order: 'asc'
});
console.log(sortedFinalList);
// The final, clean, and sorted list is ready for your campaign!
// [
// { name: 'Alice', email: 'alice@example.com' },
// { name: 'Bob', email: 'bob@example.com' },
// { name: 'Charlie', email: 'charlie@example.com' }
// ]
return sortedFinalList;
}
buildMasterContactList();
In just a few declarative steps, we’ve built a robust data processing pipeline. This is the essence of list management as code.
Q: What kind of lists can I process with lists.do?
A: You can process virtually any list of data, from simple arrays of strings like email addresses or phone numbers to complex arrays of objects. Our agents are designed to handle diverse data structures and formats.
Q: How does the deduplication feature work?
A: Our AI-powered deduplication agent intelligently identifies and removes duplicate entries from your list. You can specify a key for object-based lists or let the agent compare entire items for simple lists, ensuring a clean, unique dataset.
Q: Can I combine multiple list operations in a single workflow?
A: Yes, absolutely. The power of lists.do is in composing agents. You can chain operations like fetching a list from a source, deduplicating it, sorting it, and then sending it to another service, all within a single, automated workflow.
Stop wasting time on manual data cleaning and complex scripts. By breaking down your challenges into a series of simple list operations, you can automate even the most demanding data pipelines. Whether you're managing contact lists, processing inventory data, or reconciling financial records, lists.do provides the building blocks you need to get the job done efficiently.
Ready to streamline your data workflows? Visit lists.do to learn more and get started with our simple API.