This project was bootstrapped with Create React App.
This project demonstrates Salesforce data interaction using Node.js and jsforce. This is a POC designed to understand how A React App using Node can fetch data from a Salesforce org levaraging jsforce lib that communicates through APIs to Salesforce
Ensure you have the following libraries installed:
- jsforce
- dotenv
Run the following command to install the required dependencies:
npm install jsforce dotenv
git clone https://github.com/tomsouza4/query-data-from-salesforce-using-jsforce.git
Navigate to the project directory:
cd query-data-from-salesforce-using-jsforce
Install dependencies:
npm install
Run the React app:
npm start
Execute the script:
node src/CreateFields.js
Access Token Example:
00D8b0000022ug0!AQ8AQDTB8oa2CJdKDtx7t68ZbGid27hrU9BhTyG7WLbZBila46v5F7Gzap9pWCxVF8VDfUk.jD7h7t9q6mbYP._bjjDSQc22
Instance URL: https://wise-goat-rgjb32-dev-ed.trailblaze.my.salesforce.com
User ID: 0058b00000HEcA4AAL Org ID: 00D8b0000022ug0EAA
Total records: 22 Fetched records: 22
Fetched 22 records:
- My Account #1 (0018b00002XvzaDAAR)
- My Account #2 (0018b00002XvzaEAAR)
- My Account #1 (0018b00002XvzaIAAR)
- My Account #2 (0018b00002XvzaJAAR) ...
- Postman (0018b00002NN8lBAAT)
- Captain Bly’s Finest Treasure Chests (0018b00002NNJ56AAH)
If your Salesforce password and token include a single quote, make sure to escape it with a backslash () to prevent issues with code interpretation.
Be cautious with special characters like single quotes in your Salesforce password or token, as they might affect code interpretation.
- Create the connected app
- Set the Permitted Users & IP Relaxation