A Step-by-Step Guide to bring AI to your Project in Salesforce
Tutorial

A Step-by-Step Guide to bring AI to your Project in Salesforce

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 in your Salesforce environment. The same process applies if you want to include other features like : Image tagging, Explicit content detection, Text analysis 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:

Let's practice with Invoice parsing!

Just like Receipt and Resume Parsing, Invoice Parsing is a tool powered by OCR to extract and digitalize meaningful data, Computer Vision to identify structure of the document, and NLP 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.

Step 1. Create an Eden AI account

To begin with, you’ll need to sign in Eden AI. 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.

For detailed information regarding the Eden AI API, please refer to the provided link.https://docs.edenai.co/reference/ocr_invoice_parser_create

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:

<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.

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.

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.

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.

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, Zapier, Google App Script, Retool, Make, Dataiku, IFTTT, and n8n.

Related Posts

Try Eden AI for free.

You can directly start building now. If you have any questions, feel free to chat with us!

Get startedContact sales