Key Facts
- Category
- Data Processing
- Input Types
- textarea, checkbox
- Output Type
- text
- Sample Coverage
- 4
- API Ready
- Yes
Overview
This tool uses lodash's _.difference method to filter out values from a source array that are present in one or more exclude arrays, returning a unique array of values not found in the excludes.
When to Use
- •When you need to find elements in an array that are not in another array.
- •For data cleaning tasks where specific values must be excluded from a dataset.
- •To compare lists and identify differences, such as in inventory or user management.
How It Works
- •Input the source array as a JSON array in the designated field.
- •Provide one or more exclude arrays to specify values to remove.
- •Optionally, adjust the case sensitivity setting for string comparisons.
- •The tool processes the arrays using lodash's difference function and outputs the filtered result.
Use Cases
Examples
1. User ID Filtering
Database Administrator- Background
- You maintain a list of active user IDs and need to remove those on a temporary ban list.
- Problem
- Manually checking and removing banned IDs is inefficient and error-prone.
- How to Use
- Enter the source array of user IDs and the exclude array of banned IDs in the tool.
- Example Config
-
Source: [101, 102, 103, 104], Exclude: [102, 104] - Outcome
- The tool returns [101, 103], which are the active user IDs not banned.
2. Inventory Check
- Background
- An online store has a master list of products and wants to identify out-of-stock items based on current inventory.
- Problem
- Cross-referencing large product lists manually is time-consuming.
- How to Use
- Input the master product array and the inventory array as the exclude array.
- Outcome
- A list of products not in inventory, indicating items that need restocking.
Try with Samples
video, textRelated Hubs
FAQ
What does this tool do?
It removes values from a source array that are present in one or more exclude arrays using lodash's _.difference method.
How should I format the input arrays?
All arrays must be in valid JSON format, such as [1, 2, 3] or ['a', 'b', 'c'].
Can I exclude values from multiple arrays simultaneously?
Yes, you can use up to three exclude arrays to filter out values from the source array.
How does case sensitivity affect string comparisons?
When enabled, string comparisons are case-sensitive; disable it for case-insensitive matching.
What happens to duplicate values in the source array?
The output array contains unique values, as lodash's difference function handles duplicates by returning only distinct values not in the excludes.