Business card reader with PowerApps

AI Builder (still in preview) for PowerApps comes with a control called Business card reader and it does just its name is :)

The control exposes several properties from Company Name to Job Title, Phones etc... so basically you just click on the control select take a picture of load a picture from your gallery or hard drive and you just relax and let the control do what it does best. It takes a couples of seconds to load the different properties.

I have tested it with several different kind of business cards I can say that I had an 80% of success.

I have upload a small PowerApps app available at https://github.com/alaabitar/powerapps/blob/master/BusinessCardReader_20190625085751.zip

It reads the information from the Business card reader control and a Save button uploads the contact to a SharePoint lists named Contacts.

Here is the PnP PowerShell script to create the Contacts list :

Connect-PnPOnline -url URL_OF_YOUR_SITE

New-PnPList -Title "Contacts" -Template GenericList

Add-PnPField -List "Contacts" -DisplayName "CompanyName" -InternalName "CompanyName" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "Department" -InternalName "Department" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "Email" -InternalName "Email" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "FirstName" -InternalName "FirstName" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "FullAddress" -InternalName "FullAddress" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "FullName" -InternalName "FullName" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "JobTitle" -InternalName "JobTitle" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "LastName" -InternalName "LastName" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "Phone1" -InternalName "Phone1" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "Phone2" -InternalName "Phone2" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "Phone3" -InternalName "Phone3" -Type Text -AddToDefaultView
Add-PnPField -List "Contacts" -DisplayName "Website" -InternalName "Website" -Type Text -AddToDefaultView

On save my primary key for a Contact is its email address so the OnSelect of my Save Button is :

Set(
    _CurrentContact,
    LookUp(
        Contacts,
        Email = TextInput1_2.Text
    )
);
If(
    IsBlank(_CurrentContact),
    Patch(Contacts,Defaults(Contacts),
        {
            Title: "Contact saved with Scan business card",
            CompanyName: TextInput1.Text,
            Department: TextInput1_1.Text,
            Email: TextInput1_2.Text,
            FirstName: TextInput1_3.Text,
            FullAddress: TextInput1_4.Text,
            FullName: TextInput1_5.Text,
            JobTitle: TextInput1_6.Text,
            LastName: TextInput1_7.Text,
            Phone1: TextInput1_8.Text,
            Phone2: TextInput1_9.Text,
            Phone3: TextInput1_10.Text,
            Website: TextInput1_11.Text
        }
    ),
Patch(Contacts,
    _CurrentContact,
    {
        Title: "Contact updated with Scan business card",
        CompanyName: TextInput1.Text,
        Department: TextInput1_1.Text,
        Email: TextInput1_2.Text,
        FirstName: TextInput1_3.Text,
        FullAddress: TextInput1_4.Text,
        FullName: TextInput1_5.Text,
        JobTitle: TextInput1_6.Text,
        LastName: TextInput1_7.Text,
        Phone1: TextInput1_8.Text,
        Phone2: TextInput1_9.Text,
        Phone3: TextInput1_10.Text,
        Website: TextInput1_11.Text
    }
)
);
Notify("Contact " & _CurrentContact.FirstName & " " & _CurrentContact.LastName & " saved")

I know I have been lazy I did not rename the TextInput control but hey why don't you do better than me :)

Tell me what do you think about this new great feature!