Categories

Without Values

Remove specified values from an array using lodash _.without

Return a new array without the specified values.

Highlights:

  • Uses lodash _.without
  • Accepts values to remove as a JSON array
  • Does not mutate the original array

Example:

  • Array: [1, 2, 2, 3]
  • Values: [2]
  • Result: [1, 3]

Enter a JSON array

JSON array of values to remove

Key Facts

Category
Data Processing
Input Types
textarea
Output Type
text
Sample Coverage
4
API Ready
Yes

Overview

The Without Values tool allows you to efficiently filter arrays by removing specific elements using the reliable lodash _.without method. It generates a clean, new array based on your input, ensuring your original data remains unchanged during the processing.

When to Use

  • When you need to strip unwanted items from a large dataset or configuration array.
  • When you want to sanitize user-provided input by filtering out blacklisted values.
  • When performing data cleanup tasks where maintaining the integrity of the original array is required.

How It Works

  • Paste your source data as a JSON array into the Array field.
  • Define the specific elements you wish to exclude in the Values to Remove field as a JSON array.
  • Click the process button to generate a new array containing only the remaining items.

Use Cases

Cleaning up lists of IDs by removing deprecated or inactive entries.
Filtering out specific status codes from a log array for cleaner reporting.
Removing placeholder or default values from user-submitted configuration arrays.

Examples

1. Removing Inactive User IDs

Data Analyst
Background
A list of active session IDs contains several guest IDs that need to be excluded for a report.
Problem
Need to filter out specific guest IDs from a large array of active sessions.
How to Use
Input the full list of IDs in the Array field and the guest IDs in the Values to Remove field.
Example Config
Array: [101, 102, 999, 103, 999], Values: [999]
Outcome
The tool returns [101, 102, 103], successfully removing all instances of the guest ID.

2. Sanitizing Configuration Tags

Developer
Background
A configuration file includes a list of tags, but some tags are marked as 'deprecated' and should not be processed.
Problem
Quickly remove 'deprecated' and 'legacy' tags from the active tag list.
How to Use
Paste the tag array and specify the tags to remove in the configuration fields.
Example Config
Array: ["ui", "deprecated", "api", "legacy", "db"], Values: ["deprecated", "legacy"]
Outcome
The tool returns ["ui", "api", "db"], providing a clean list for the application.

Try with Samples

json, video

Related Hubs

FAQ

Does this tool modify my original array?

No, the tool returns a new array and does not mutate the original input.

What format should my inputs be in?

Both the Array and Values to Remove fields require valid JSON array syntax, such as [1, 2, 3] or ["apple", "banana"].

Can I remove multiple values at once?

Yes, simply include all the values you want to remove within the JSON array in the Values to Remove field.

Is this tool case-sensitive?

Yes, when working with strings, the tool respects case sensitivity as per standard JavaScript comparison.

What library does this tool use?

This tool utilizes the lodash _.without function to ensure consistent and accurate filtering.

API Documentation

Request Endpoint

POST /en/api/tools/without-values

Request Parameters

Parameter Name Type Required Description
array textarea Yes Enter a JSON array
values textarea Yes JSON array of values to remove

Response Format

{
  "result": "Processed text content",
  "error": "Error message (optional)",
  "message": "Notification message (optional)",
  "metadata": {
    "key": "value"
  }
}
Text: Text

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-without-values": {
      "name": "without-values",
      "description": "Remove specified values from an array using lodash _.without",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=without-values",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]