|List||the list used to store the list of input files|
|Boolean||the flag used to check whether input file was processed or not||false|
|Table||required to collect recognized contacts and then insert into file|
|String||the path to the folder with input files (images)|
|Secret||Salesforce username (need to be set up before script running)|
|Secret||Salesforce password (need to be set up before script running)|
|Table||required to collect non-recognized contacts and insert into a separate file|
|String||Salesforce login page||https://login.salesforce.com/|
|String||Salesforce Contacts page||https://ap5.lightning.force.com/one/one.app#/sObject/Contact/list?filterName=all|
|String||required to store Salesforce verification code|
Process input files
Description: The group opens input files with images, recognizes business cards, and stores information into temporary Table variables. In case no template for a business card is found, the file information is added into a separate file.
|Get Folder Contents||In this action, bot gets the list of .png files from the folder mentioned in the |
|For Each||In the For Each loop, files from the list are checked according to the existing templates. Recognized information is stored into the |
The steps are needed to open a .png file via the default viewer. The Wait action is required to give time to open the file and load the image.
Before processing each image file, the
|Bot checks which predefined template is used in the separate file.|
|IF-Else||The template check group starts with checking the |
|Wait for Image||Bot waits for the image that is specific for each predefined template. If the image is found on the screen, the result becomes |
If the template is found, bot processes with the contact recognition.
When the template is found, bot can extract needed data using the OCR action.
Exception Handling is added to process with different screen resolutions, as OCR functionality is sensitive to image quality.
The actions are added to format recognized information and used to:
In this specific template, there is no phone number on the business card image, so the phone number will be reflected as a dash in the output.
|On processing the file successfully, the |
|If none of the predefined template is found, the file name is added to the list of non-recognized images and stored in the |
|Enter Keystrokes||At the end of the input file processing, bot closes the opened file with the key combination Alt + F4.|
Export recognized contacts to .csv file
Description: The group exports successfully recognized contacts to the output .csv file.
Bot creates a file named
In For Each loop, all the recognized contacts are processed from the
The custom script helps to add the end-of-line character (
How to reuse
You can easily use this script in other projects. For this, you just need to change the file name (here,
Open and upload data to Salesforce
Description: The group allows to log into Salesforce account with two-factor authentication and upload the .csv file into Salesforce contacts. The whole block can be used in other projects, no specific changes are required.
How To Reuse
To reuse the group, make sure you have added the required Salesforce credentials in Secrets Vault in WorkFusion Studio. If you add another Secret Vault entry, change the following variables:
login– Salesforce username (Secrets Vault > Key)
password– Salesforce password (Secrets Vault > Value)
The group of actions opens the Salesforce login page mentioned in the
Salesforce sends a verification code to the email that is set in the Salesforce user account.
Exception Handling is added to process different Outlook versions.
The Wait action is added to give the page time to load all its content.
Bot will find the verification email if the Outlook view is configured as below:
|On entering the verification code on the Salesforce page, bot opens the Contacts page with the All contacts option, clicks on the Import button, and uploads the |