Add Flow Action: Remove Duplicate Objects by Key#240
Merged
SapphicFire merged 1 commit intoServiceNowDevProgram:mainfrom Oct 28, 2025
Merged
Add Flow Action: Remove Duplicate Objects by Key#240SapphicFire merged 1 commit intoServiceNowDevProgram:mainfrom
SapphicFire merged 1 commit intoServiceNowDevProgram:mainfrom
Conversation
…JSON array based on a specified key. The Action supports options to keep either the first or last occurrence, handle case sensitivity, and trim whitespace from values. It outputs a structured JSON object containing the cleaned list and useful metadata (total input, output, and removed items).
|
✅ Valid PR for ActionPack Thank you for your contribution. This PR complies with the CONTRIBUTING.md. |
SapphicFire
approved these changes
Oct 28, 2025
Contributor
SapphicFire
left a comment
There was a problem hiding this comment.
Looks good to me! Thank you for your contribution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This contribution adds a reusable Flow Action that removes duplicate objects from a JSON array based on a specified key. It is designed to simplify data cleanup and normalization in Flows and Subflows.
How It Works
The Flow Action accepts a JSON array of objects and removes duplicates according to a field specified by the user.
You can choose whether to keep the first or last occurrence, and optionally make the comparison case-insensitive and trim whitespace before evaluating duplicates.
Inputs
array: JSON string representing an array of objects to process.
Example:
key: Object field name used to detect duplicates. Example: email.
keep: Determines whether to keep the first or last occurrence of duplicated entries.
case_insensitive: When true, treats field values as case-insensitive (A@ex.com equals a@ex.com).
trim: When true, trims whitespace before comparing values (e.g., " a@ex.com " equals "a@ex.com").
Outputs
JSON object containing the cleaned list and metadata:
Example Use Case
Use this Action to remove duplicate user records by email before performing bulk insert or update operations via Flow Designer.
This helps ensure data integrity, especially when processing large datasets or integrating external APIs.