Skip to content

Latest commit

 

History

History
136 lines (101 loc) · 6.36 KB

File metadata and controls

136 lines (101 loc) · 6.36 KB

📖 Summary

📝 About Salesforce

Salesforce, Inc. is an American cloud-based software company headquartered in San Francisco, California. It provides customer relationship management (CRM) software and applications focused on sales, customer service, marketing automation, e-commerce, analytics, and application development.

Prerequesit

In order to leverage the Salesforce connector you need to perform initial setup of HrFlow tables in your Salesforce integration. The code below uses Salesforce API to create the following Salesforce Custom Objects:

  • Hrflow_Job__c
  • Hrflow_Profile__c
    • Hrflow_Experience__c
    • Hrflow_Education__c
    • Hrflow_Attachment__c

💡 Before running the code you can review all details about the Custom Objects in this JSON file

In order to run code below you need:

  • API Access enabled for your organization. Check this link to see if it is supported by your Salesforce Edition
  • A Salesforce user with API Enabled permission and enough privileges to create Custom Objects
  • Install the simple-salesforce Python package
import json

from simple_salesforce import Salesforce

HRFLOW_CUSTOM_OBJECTS_PATH = "./hrflow_custom_objects.json"

# Salesforce credentials
username = "==============FILL==ME=============="
password = "==============FILL==ME=============="
# How Can I Find My Security Token and Use It in Data Loader | Salesforce Platform
# https://www.youtube.com/watch?v=nYbfxeSGKFM&ab_channel=SalesforceSupport
security_token = "==============FILL==ME=============="
# Find your Salesforce Organization ID
# https://help.salesforce.com/s/articleView?id=000385215&type=1
organization_id = "==============FILL==ME=============="

sf = Salesforce(username=username, password=password, security_token=security_token, organizationId=organization_id)
mdapi = sf.mdapi

with open(HRFLOW_CUSTOM_OBJECTS_PATH, "r") as f:
    hrflow_custom_objects = json.load(f)

for custom_object  in hrflow_custom_objects:
    _custom_object = mdapi.CustomObject(
        fullName = custom_object["object_name"],
        label = custom_object["label"],
        pluralLabel = custom_object["pluralLabel"],
        nameField = mdapi.CustomField(
            label = "Name",
            type = mdapi.FieldType("Text")
        ),
        fields=[
            mdapi.CustomField(
                **field,
            ) for field in custom_object["fields"]
        ],
        deploymentStatus = mdapi.DeploymentStatus("Deployed"),
        sharingModel = mdapi.SharingModel("ReadWrite")
    )
    mdapi.CustomObject.create(_custom_object)

How to create list view of HrFlow Custom Objects

Once logged to your Salesforce environment go to Setup then click Create > Custom Tab. Once created you should be able to view the list of records in each of the tables.

HrFlow Jobs HrFlow Profiles HrFlow Educations HrFlow Experiences HrFlow Attachments

Hrflow.ai Recruiter Copilot Widget installed in Salesforce

Scoring

📊 Data Flow

In this section, we outline the data flow between different components of the connector. The following schema provides a graphical representation of the data exchange process

🔌 Connector Actions

Action Description
Pull profile list Retrieves profiles from Salesforce HrFlow Profile & Co Custom Objects and writes them to an Hrflow.ai source
Push profile Pushs specific Profile from HrFlow and writes it to HrFlow_Profile__c & Co Custom Objects in Salesforce
Pull job list Retrieves jobs from Salesforce HrFlow Job Custom Object and writes them to an Hrflow.ai board

🐍 Quick Start Examples

To make sure you can successfully run the latest versions of the example scripts, you have to install the package from PyPi. To browse the examples of actions corresponding to released versions of 🤗 this connector, you just need to import the module like this :

Once the connector module is imported, you can leverage all the different actions that it offers.

For more code details checkout connector code

🔗 Useful Links

👏 Special Thanks