This article explains how you can use the Sql2Xink tool to pull data from a SQL data source to Employees in Xink. This is often used if your Active Directory (AD) is not updated and your HR department maintains the data in an ERP system.
The Sql2Xink tool will pull the data automatically when you set it up as a scheduled task or run it from a cmd prompt.
The tool features a user interface where you can configure a connection string and a SQL SELECT statement to pull the data from your database. You will also be able to map fields from your SELECT statement to fields in your Xink account. We will walk you through the steps below.
Download the installer and double-click the file Sql2XinkSetup.msi to install the tool.
First, you need to configure the tool. Click "Configure Xink Sql2Xink" from the Start menu which will start the main menu.
Connect to your SQL Server database
Click "Connect to the database" to connect the tool to your SQL Server.
Enter the connection string and click "Test" to test the connection.
Example of a Connection String:
Provider=sqloledb;Data Source=SERVERNAME;Initial Catalog=eMailSignature;User Id=eMailSignature_Superuser;Password=changemenow;
Click "Save" to save the connection string.
Connect to Xink Cloud
Click the button "Connect to Xink Cloud" to connect the tool to Xink's API.
You need a Xink API user to connect. Read the article on how to create an API user.
The API user must have these permissions set:
Enter the username and password for your API user and click "Test" to make sure that the API user login checks out ok. Click "Save" to keep your settings and dismiss the dialog.
Map fields from SQL to Xink
The final step is to tell Sql2Xink which fields from the SQL database goes where in Xink. Click "Map fields" to set the mapping.
Enter your SQL SELECT statement at the top. The SQL FROM must include the SQL table.
Now click "Refresh fields". Sql2Xink will now get the fields from your SQL statement, and it will contact the Xink API to retrieve all fields for your Xink account. If the field names from your SQL statement match the Xink field names, the tool will automatically set up a mapping between the two.
Use the dropdowns to set where the SQL fields should go in Xink.
In some cases you may not want to update a field in Xink if the corresponding field in your SQL database is NULL or empty.
In that case you should check the "Ignore when empty" checkbox. For example, in the screenshot above, JobTitle will not be overwritten in Xink if it is empty in the SQL database. Click "Save" to save your mappings and dismiss the dialog.
Test the configuration
Now the time has come to test the export from your SQL database to Xink.
Start a cmd prompt and run Sql2Xink.exe update from the cmd prompt.
For a default installation, you will find Sql2Xink.exe in C:\Program Files (x86)\Xink Sql2Xink.
Check for any errors in the output.
Run Sql2Xink on a schedule
To always keep Xink updated from your SQL database, you should set up a scheduled task to run 'Sql2Xink.exe update' on a daily basis.
Remove users that are no longer in the SQL database
Sql2Xink can remove employees from Xink that are no longer present in the SQL database. You can enable this feature by adding the --remove switch when you run 'Sql2Xink.exe update', e.g. 'Sql2Xink.exe update --remove'. You may also use the shorter version 'Sql2Xink.exe update -r'.
You can always get help from the cmd prompt by running 'Sql2Xink.exe help update'.
Preserving Manual Edits
Sql2Xink will preserve user changes when the "Do not update fields that were set or changed manually" is enabled in the Xink portal. This includes fields that were manually edited by Xink admins and modified fields that were set to be "Editable by employee". See How to enable Preserve Manual Edits Feature.