FuzzyWuzzy Algorithm with Salesforce Flow

FuzzyWuzzy UI

Hi Folks!

In this article, I’d like to show you about my porting result from xdrop’s Java FuzzyWuzzy algorithm (originally from python FuzzyWuzzy)

Why FuzzyWuzzy in Salesforce?
- This package will help you to automate a bunch of boring stuffs related to string processing in Salesforce
- Previously, I used Python FuzzyWuzzy library to process my strings. So to have this function, I needed to expose an API to serve requests from Salesforce and Salesforce will need to callout to that API. But with this, no more callout!
- Currently, Salesforce has similar function which is Contains, but with sometimes, contains is not enough because contains doesn’t care about typos and abbreviation when we’re matching strings. So, you’ll need a new function to achieve this

So, what is FuzzyWuzzy?

FuzzyWuzzy (or Fuzzy Matching) is a method to calculate similarity in percentage between 2 strings. It uses Levenshtein Distance to calculate the similarity.

How to use Fuzzywuzzy in Salesforce Flow?

a. Install this package to your Salesforce org (don’t forget to change login to test.login if you want to install in sandbox): https://login.salesforce.com/packaging/installPackage.apexp?p0=04t2w000009F5gY
source code: github

b. After package installed, you’ll have a new Apex Action to execute your FuzzyWuzzy operation. The Apex Action name is: FuzzyWuzzy Scoring

Image1: New Apex Action to perform FuzzyWuzzy

c. There will be 3 Inputs and 1 Output you’ll need to config.
Inputs
FuzzyWuzzy Logic: See Supported FuzzyWuzzy logic below
String01: 1st String you want to compare
String02: 2nd String you want to compare
Output
Score: Similarity score (in percentage)

Supported FuzzyWuzzy Logic:

Basic Functions:

  1. SimpleRatio :
    Allows us to calculate the Levenshtein distance similarity ratio between the two strings (sequences)
  2. PartialRatio:
    Allows us to perform substring matching. This works by taking the shortest string and matching it with all substrings that are of the same length.
Image2: Example SimpleRatio
Image3: Example PartialRatio

The good news is you’ll be able to test the function before you install the package. You can visit this and you’ll have an access to User interface to test the FuzzyWuzzy flow.

Enjoy and drop a comment if you have troubles or feedbacks for my writing. I’ll try my best to help you folks!

Credits:

  • xdrop
  • seatgeek
  • Adam Cohen
  • David Necas (python-Levenshtein)
  • Mikko Ohtamaa (python-Levenshtein)
  • Antti Haapala (python-Levenshtein)
  • Tobias Burdow (burdoto)
  • Jason Wong (use case)

--

--

--

A dots connector. open for part time, Email: munawirrahman@gmail.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Hire Mobile App Developers — iTechnoLabs

Neo Monthly Report — July 2020

Tutorial: Setting Up the Honey Framework Algo Server

Python data type

Storing Images on Cloudinary to Use for Your Rails Backend

FLUTTER ESSENTIALS — II

Use CameraX with Image Segmentation android project.

Fastest way to migrate database from mLab to MongoDB Atlas

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Munawirrahman

Munawirrahman

A dots connector. open for part time, Email: munawirrahman@gmail.com

More from Medium

Eight Sessions to Have a Look Out for at This Year’s Czech Dreamin’ Event

How to evaluate multiple conditions in aura:if else condition on Lightning Component Salesforce |…

Deployment on production Environment in salesforce

Connected app in Salesforce for absolute beginners

Salesforce Session Id in cookies