Skip to content

Conversation

@shivamvish160
Copy link
Contributor

This PR is raised to provide solution for one of the active issues in Action pack repo
here is the link of issue: #102

ServiceNow Flow Designer Action: Flag Duplicates Using u_duplicate_of

📌 Description

This Flow Designer Action identifies and flags duplicate records in a specified ServiceNow table using a reference field u_duplicate_of. It compares records based on user-defined match fields and links duplicates to their original entries without deleting any data.


🎯 Purpose

  • Automate duplicate detection across any table
  • Flag duplicates without deleting records
  • Maintain traceability using reference links

🧾 Inputs

NameTypeDescriptiontable_nameStringName of the table to scan for duplicates| match_fields | String | Comma-separated list of fields used to detect duplicates |


📤 Outputs

Name Type Description
merged_pairs Array List of objects with original and flagged record sys_ids
error String Error message if the action fails (optional)

🚀 Usage Example

Inputs:

{
"table_name": "incident",
"match_fields": "caller_id,short_description"
}

Outputs:

{
"merged_pairs": [
{ "original": "abc123", "flagged": "def456" },
{ "original": "ghi789", "flagged": "jkl012" }
],
"

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Valid PR for ActionPack

Thank you for your contribution. This PR complies with the CONTRIBUTING.md.
A maintainer will review this shortly. In the meantime, Happy Hacking!

@rohi-v rohi-v self-assigned this Oct 8, 2025
Copy link
Contributor

@rohi-v rohi-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @shivamvish160

The records are getting updated but i still see below value in merged pairs output.
image

@shivamvish160
Copy link
Contributor Author

Hi @shivamvish160

The records are getting updated but i still see below value in merged pairs output. image

Hi @rohi-v
Can you please provide me the input's which you are giving for the action?

@rohi-v
Copy link
Contributor

rohi-v commented Oct 8, 2025

table_name is incident and match_fields as caller_id and also tried with caller_id and short_description too.
@shivamvish160

@rohi-v rohi-v requested a review from SapphicFire October 8, 2025 15:38
@shivamvish160
Copy link
Contributor Author

shivamvish160 commented Oct 8, 2025

@rohi-v For the same input i am getting the output for passing table as incident and match fields as caller_id,short_description
PFA image for reference
image
@rohi-v @SapphicFire @snamjosh
Kindly review

@rohi-v
Copy link
Contributor

rohi-v commented Oct 8, 2025

Thank You for your submission

It's working for small amount of data and not able to return properly for large run.

The output types of the script step and outputs are causing this issue.

@rohi-v
Copy link
Contributor

rohi-v commented Oct 8, 2025

Closing this for now. Once you make additional changes, feel free to re-open this Pull Request or create a new one.

@rohi-v rohi-v closed this Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants