Skip to content

Conversation

@anurampalli
Copy link
Contributor

…ts by removing a specified number of header lines. The script fetches the target attachment, skips the requested number of lines, and outputs the cleaned CSV content. Optionally, it can write back the cleaned data as a new attachment. Handles missing content and errors gracefully.

Inputs(attachmentSysId, linesToSkip,writeBackAsAttachment, parentTable, parentSysId, newFileName) Outputs (cleanedCSV, cleanedAttachmentSysId)

…ts by removing a specified number of header lines. The script fetches the target attachment, skips the requested number of lines, and outputs the cleaned CSV content. Optionally, it can write back the cleaned data as a new attachment. Handles missing content and errors gracefully.

Inputs(attachmentSysId, linesToSkip,writeBackAsAttachment, parentTable, parentSysId, newFileName)
Outputs (cleanedCSV, cleanedAttachmentSysId)
@github-actions
Copy link

github-actions bot commented Oct 3, 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!

@kmohit2809 kmohit2809 self-assigned this Oct 3, 2025
@SapphicFire
Copy link
Contributor

Looks good to me! In future, here are some things to consider:

  • Better variable names: Using gr as a variable name is considered bad practice because it can collide with other invocations due to how Mozilla Rhino executes in ServiceNow. Making the names more descriptive further helps with readability of your code
  • Defaults and validation: Consider providing defaults in your inputs, and validations. Lines to skip could theoretically be given a negative integer, and likewise Parent table could have had its default set as sys_email, as opposed to setting this inside the script.

This is a good contribution and I'm eager to see what else you bring to this year. Good luck developing!

Copy link
Contributor

@SapphicFire SapphicFire left a comment

Choose a reason for hiding this comment

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

lgtm

@SapphicFire SapphicFire self-assigned this Oct 4, 2025
@SapphicFire SapphicFire merged commit 404dc56 into ServiceNowDevProgram:main Oct 4, 2025
@anurampalli
Copy link
Contributor Author

Thank you SapphicFire! 😊

@anurampalli anurampalli deleted the feature/strip-lines-from-csv branch October 4, 2025 08:48
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.

3 participants