Files

1003 B

Salesforce PDF Attachment Automation

A Node.js utility that extracts text and metadata (like Codice Fiscale and Name variations) from PDF documents and automatically attaches them to the corresponding Account records in a Salesforce Sandbox.


Features

  • PDF Parsing: Reads local PDF files and extracts metadata using regex matching.
  • Smart Account Matching: Queries Salesforce Accounts by Codice Fiscale or Name permutations (first name / last name variations).
  • Automated Uploads: Converts PDFs to Base64 strings and attaches them directly to Accounts in Salesforce via ContentVersion.
  • Duplicate Protection: Filters and sorts matching accounts by creation date.

Prerequisites

Before running this project, ensure you have:

  • Node.js
  • A Salesforce Sandbox account with API access
  • Salesforce Security Token

sfdc2.js

This projects uses the sfdc2.js library which facilitates interaction with the Salesforce API.