Key Facts
- Category
- Data Processing
- Input Types
- textarea, text
- Output Type
- text
- Sample Coverage
- 4
- API Ready
- Yes
Overview
Uniq By is a powerful data processing utility that allows you to efficiently remove duplicate objects from a JSON array based on a specific property path using the reliable lodash _.uniqBy method.
When to Use
- •When you need to clean up API responses that contain redundant object entries.
- •When processing large datasets where you must ensure unique records based on a specific ID or key.
- •When you need to filter nested JSON structures by targeting specific property paths.
How It Works
- •Paste your JSON array into the input field.
- •Specify the property path (e.g., 'id' or 'user.email') you want to use for comparison.
- •The tool processes the array using lodash _.uniqBy to identify and remove duplicates.
- •Copy or download the resulting unique JSON array.
Use Cases
Examples
1. Deduplicate User List
Data Analyst- Background
- I have a list of users exported from a database, but some users appear multiple times due to system sync errors.
- Problem
- I need to remove duplicate user objects based on their unique 'email' field.
- How to Use
- Paste the user array into the input and enter 'email' in the Property Path field.
- Example Config
-
path: 'email' - Outcome
- A clean list where each email address appears exactly once.
2. Filter Nested API Response
Frontend Developer- Background
- An API endpoint is returning a list of transactions, but some transactions are duplicated with the same 'transaction_id' inside a 'data' object.
- Problem
- I need to filter the array to keep only unique transactions based on the nested ID.
- How to Use
- Paste the JSON response and use 'data.transaction_id' as the property path.
- Example Config
-
path: 'data.transaction_id' - Outcome
- A refined array containing only unique transaction records.
Try with Samples
json, videoRelated Hubs
FAQ
What does the Property Path field do?
It tells the tool which specific key or nested path to look at when determining if two objects are duplicates.
Can I use nested paths?
Yes, you can use dot notation (e.g., 'meta.id') to target properties nested within objects.
What happens if I leave the Property Path empty?
If no path is provided, the tool will treat the entire object as the value for comparison.
Is this tool case-sensitive?
Yes, the comparison follows standard JavaScript equality rules, meaning 'ID' and 'id' are treated as different values.
Does this tool modify my original data?
No, the tool processes your input and generates a new, unique output; your original data remains unchanged.