A Step-by-Step Guide to bring AI to your Project in Salesforce
Tags: salesforce, ai, api, crm
Published: 2023-05-17 15:53:56

*Salesforce is a proficient customer relationship management (CRM) tool that aids in the management of customer interactions. In this article, we'll take you step-by-step through the integration of [Eden AI's Invoice Parser API](http://www.edenai.co/feature/ocr-invoice?referral=integrate-invoice-parser-bubble) in your Salesforce environment. The same process applies if you want to include other features like : [Image tagging](https://www.edenai.co/feature/object-detection?referral=integrate-invoice-parser-bubble), [Explicit content detection](https://www.edenai.co/feature/object-detection?referral=integrate-invoice-parser-bubble), [Text analysis](https://www.edenai.co/technologies/text?referral=integrate-invoice-parser-bubble) and many more AI APIs we offer.*

‍

## **Build AI on Salesforce with Eden AI**

Managing multiple accounts for each app can be a tough job, but with Eden AI, you can connect and manage all your APIs on a single account.

‍

Eden AI allows you to solve multiple AI tasks on Salesforce:

- [Document parsing](https://www.edenai.co/feature/ocr?referral=integrate-invoice-parser-bubble): extracting text from images and [parsing invoice](https://www.edenai.co/feature/ocr?referral=integrate-invoice-parser-bubble), [receipt](https://www.edenai.co/feature/ocr-receipt?referral=integrate-invoice-parser-bubble) or resume to extract data
- ‍[Computer vision](https://www.edenai.co/feature/object-detection?referral=integrate-invoice-parser-bubble): detect [faces](https://www.edenai.co/feature/face-detection?referral=integrate-invoice-parser-bubble), [objects](https://www.edenai.co/feature/object-detection?referral=integrate-invoice-parser-bubble), logos, [explicit content](https://www.edenai.co/feature/explicit-content-detection?referral=integrate-invoice-parser-bubble), etc.
- Text analysis: [sentiment analysis](https://www.edenai.co/feature/sentiment-analysis?referral=integrate-invoice-parser-bubble), [keyword extraction](https://www.edenai.co/feature/keyword-extraction?referral=integrate-invoice-parser-bubble), [summarization](https://www.edenai.co/feature/summarization?referral=integrate-invoice-parser-bubble), etc.
- ‍[Machine Translation](https://www.edenai.co/post/best-machine-translation-apis?referral=integrate-invoice-parser-bubble)
- [‍](https://www.edenai.co/post/best-machine-translation-apis?referral=integrate-invoice-parser-bubble)[Speech recognition](https://www.edenai.co/post/which-speech-recognition-api-to-choose-for-your-project?referral=integrate-invoice-parser-bubble) & Speech generation

‍

## **Let's practice with [Invoice parsing](http://www.edenai.co/feature/ocr-invoice?referral=integrate-invoice-parser-bubble)!**

**‍**Just like [Receipt](https://www.edenai.co/post/top-10-ocr-receipt-parser-api?referral=integrate-invoice-parser-bubble) and [Resume](https://www.edenai.co/post/top-10-ocr-resume-parser-api?referral=integrate-invoice-parser-bubble) Parsing, Invoice Parsing is a tool powered by [OCR](https://www.edenai.co/post/analyze-easily-document-files-with-ai-optical-character-recognition-ocr?referral=integrate-invoice-parser-bubble) to extract and digitalize meaningful data, [Computer Vision](https://www.edenai.co/post/best-computer-vision-apis?referral=integrate-invoice-parser-bubble) to identify structure of the document, and [NLP](https://www.edenai.co/post/best-natural-language-processing-apis?referral=integrate-invoice-parser-bubble) techniques to pin down the fields. Invoice parser technology extracts key information from an invoice (.pdf, .png or .jpg format) such as the invoice ID, total amount due, invoice date, customer name, etc.

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/6464edaa595d70accf7a845a_invoice_parsing.webp](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/6464edaa595d70accf7a845a_invoice_parsing.webp)

‍

### **Step 1. Create an Eden AI account**

To begin with, you’ll need [to sign in Eden AI](https://app.edenai.run/user/register?referral=integrate-invoice-parser-salesforce). If you don’t have an account yet, we’re offering $10 upon registration. Once you have successfully signed up, you will gain access to the platform's features, including the ability to establish integrations with various platforms, including Salesforce.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yy6j3ndpl2vkix3wfj8z.png)


**[Get your API key for FREE](https://app.edenai.run/user/register?referral=integrate-invoice-parser-salesforce)**

For detailed information regarding the Eden AI API, please refer to the provided link.[https://docs.edenai.co/reference/ocr_invoice_parser_create](https://docs.edenai.co/reference/ocr_invoice_parser_create?referral=integrate-invoice-parser-bubble)

‍

### **Step 2. Create a LWC Component in Salesforce**

To connect Eden AI Invoice Parser to your Salesforce environment, you'll need to create an LWC Component in Salesforce. It’s one of the easiest ways to connect and test the API. Follow these steps:

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/64635110cc057db2926c77cf_pic%201.png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/64635110cc057db2926c77cf_pic%201.png)

‍

‍

```
<template> <img src="https://templates.invoicehome.com/invoice-template-in-neat-750px.png" > <template/>

```
‍

We’ve included an image in the HTML file that serves as a sample invoice for Eden AI. Please note that this image is solely for our reference and is displayed in the user interface (UI) for illustrative purposes only.

‍

![https://templates.invoicehome.com/invoice-template-in-neat-750px.png](https://templates.invoicehome.com/invoice-template-in-neat-750px.png)

‍

Don’t forget to put your API KEY and IMAGE URL in the .JS file

```
import {LightningElement }from "lwc";
export default class EdenAIInvoiceParser extends LightningElement {
	connectedCallback() {
  	const options = {
    	method: "POST",
      headers: {
      	"accept": "application/json",
        "content-type: "application/json",
        "authorization": "Bearer YOUR_API_KEY_HERE"},
      body: JSON.stringify({
      	response_as_dict: true,
        attributes_as_list: false,
        show_original_response: false,
        providers: "amazon,base64,dataleon,mindee,google,affinda,microsoft",
        file_url: "Add Invoice Image file URL"
        })
      };
     fetch("https://api.edenai.run/v2/ocr/invoice_parser", options)
     	.then(response => response.json())
      .then(response => console.log(response))
      .catch(err => console.error(err));}}
```

‍

### **Step 3. Test your Eden AI Component**

Deploy this component in your Salesforce organization. For testing purposes, you can add this component to any Lightning Page.

Here is an example of our component deployed on a Lightning Page:

‍

In the Component section, you will find a list of both standard and custom components. Our LWC component is a custom component, so simply drag and drop it onto your Lightning page.

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/646351d422af13a00b2a2cae_pic%202.png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/646351d422af13a00b2a2cae_pic%202.png)

‍

In the image below, you can observe the component after it has been dragged and dropped onto the page. Make sure to save these changes.

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/646351da6bbfb7a8d9365e5c_pic%203.png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/646351da6bbfb7a8d9365e5c_pic%203.png)

‍

Next, navigate to your Account list view and open any record. In the browser console, you will be able to see the API response based on the data from your invoice image.

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/646351e098f456345c470024_pic%204.png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/646351e098f456345c470024_pic%204.png)

‍

Establishing a connection between Eden AI and your Salesforce environment is a straightforward process. With this integration, you'll be able to analyze your data in new ways, make more informed decisions, and automate certain tasks.

‍

*If you're interesting in more integration tools, have a look at our step-by-step tutorials on how to bring AI to your application with [Power Apps](https://www.edenai.co/post/a-step-by-step-guide-to-integrating-edenai-invoice-parser-on-microsoft-powerapps?referral=integrate-invoice-parser-bubble), [Zapier](https://www.edenai.co/post/a-step-by-step-guide-to-bring-ai-to-your-app-using-zapier?referral=integrate-invoice-parser-bubble), [Google App Script](https://www.edenai.co/post/a-step-by-step-guide-to-integrating-ai-in-your-app-with-google-app-script?referral=integrate-invoice-parser-bubble), [Retool](https://www.edenai.co/post/a-step-by-step-guide-to-implementing-ai-in-your-app-using-retool?referral=integrate-invoice-parser-bubble), [Make](https://www.edenai.co/post/how-to-integrate-invoice-parsing-into-your-application-using-make?referral=integrate-invoice-parser-bubble), [Dataiku](https://www.edenai.co/post/a-step-by-step-guide-to-bring-ai-to-your-app-using-daitaku-dss?referral=integrate-invoice-parser-bubble), [IFTTT](https://www.edenai.co/post/a-step-by-step-guide-to-implementing-ai-in-your-app-using-retool?referral=integrate-invoice-parser-bubble), and [n8n.](https://www.edenai.co/post/a-step-by-step-guide-to-implementing-ai-in-your-app-with-n8n?referral=integrate-invoice-parser-bubble)*

‍

**[Create your Account on Eden AI](https://app.edenai.run/user/register?referral=integrate-invoice-parser-salesforce)**