Key Facts
- Category
- Data Processing
- Input Types
- textarea, select, checkbox
- Output Type
- text
- Sample Coverage
- 4
- API Ready
- Yes
Overview
Concat Arrays is a utility tool that merges up to five arrays into a single array using lodash's _.concat method. It supports optional flattening of nested arrays and deduplication to remove duplicate values, making it ideal for combining data from multiple sources.
When to Use
- •When you need to combine multiple arrays into a single list for batch processing or analysis.
- •When dealing with nested arrays that require flattening to simplify data structures.
- •When merging arrays while ensuring no duplicate values are included in the result.
How It Works
- •Input up to five arrays in JSON or text format using the provided text areas.
- •Select a flatten mode: 'none' to keep nested arrays, 'shallow' to flatten one level, or 'deep' to flatten all levels.
- •Optionally enable the 'Remove Duplicates' checkbox to eliminate duplicate values based on strict equality.
- •The tool concatenates the arrays and applies the selected options to produce the final array output.
Use Cases
Examples
1. Combine User ID Lists
- Background
- A developer has three separate arrays of user IDs from authentication, profile, and activity modules.
- Problem
- Need to merge these arrays into one for a batch update operation without duplicates.
- How to Use
- Enter each array in the array1, array2, and array3 fields, then enable 'Remove Duplicates' and concatenate.
- Outcome
- A single array containing all unique user IDs from the three modules, ready for processing.
2. Flatten Nested Sales Data
- Background
- A data analyst receives sales figures as nested arrays from regional reports, with some duplicate entries.
- Problem
- The nested structure complicates analysis, and duplicates need to be removed for accurate totals.
- How to Use
- Input the arrays, set flatten mode to 'deep', and enable 'Remove Duplicates' before concatenating.
- Outcome
- A flattened array with unique sales figures, simplifying further analysis and visualization.
Try with Samples
videoRelated Hubs
FAQ
What is array concatenation?
Array concatenation is the process of joining two or more arrays end-to-end to form a new array.
How does the flatten mode affect the result?
Flatten mode controls nested arrays: 'none' keeps them as is, 'shallow' flattens one level, and 'deep' flattens all nested levels.
Can I remove duplicates from the concatenated array?
Yes, by enabling the 'Remove Duplicates' option, the tool will eliminate duplicate values using strict equality checks.
What data types are supported?
The tool supports numbers, strings, booleans, null, objects, and arrays, with smart type detection for accurate concatenation.
How many arrays can I concatenate at once?
You can concatenate up to five arrays simultaneously using the array1 to array5 input fields.