# Lucca

The integration between Cards and Lucca allows you to:

* import your collaborators into Cards
* import your departments (configured in Lucca) into Cards (in the form of groups)
* bring back Cards user statistics into Lucca, on collaborator files.

{% hint style="info" %}
[Contact-us](https://www.cards-microlearning.com/contact) to enable Lucca integration on your Cards space.
{% endhint %}

### Configuration

Once the integration is activated on your space (by us), you will be able to access its configuration by going to the "Integrations and applications" page, then clicking on "Configuration" on the Lucca block.

<figure><img src="https://4091897493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2QF90YKjb0mULStqbTyr%2Fuploads%2FwzLtGQ6Kt8oGXdVEmc9W%2Fconfig-lucca.jpg?alt=media&#x26;token=ef2e273e-54e9-4d15-85d4-5b2f5df3107d" alt=""><figcaption><p>Lucca configuration</p></figcaption></figure>

On this page you will need to fill in several fields:

* **Lucas Domain - URL**: this is the URL of your Lucca account
* **oAuth credentials**: your Lucca oAuth credentials (used for synchronization from Lucca to Cards)
* **API key**: this is the API key that Lucca provides you (used for synchronization from Cards to Lucca).

{% hint style="info" %}
Cards needs both types of identifier (oAuth and API key), because the new Lucca API - using oAuth - does not yet support sending information on employee records.
{% endhint %}

#### oAuth credentials

To obtain an OAuth ID, go to your Lucca account, then to Settings > OAuth Applications. You can then add a new application. During creation, you must choose the following scopes: `departments.readonly` and `employees.readwrite`.

#### API key

To create an API key, go to your Lucca account, then to Settings > API Keys.

Next, click on "Generate a new API key". You must check the box "Collaborators: View / create / edit users" to grant access to collaborator profiles.

#### Cards configuration

On Cards, from this screen, you can decide whether or not to activate the synchronization of statistics (from Cards to Lucca).

If you activate the synchronization, additional fields appear. They allow you to choose in which fields the statistics will be uploaded on your employee files. More details below, in the "Statistics synchronization" section.

Once the configuration is saved, 2 additional tabs appear, for the synchronization of users and departments.

### Import users

By going to the "User Sync" tab, you will arrive on a page that lists your collaborators present in Lucca:

<figure><img src="https://4091897493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2QF90YKjb0mULStqbTyr%2Fuploads%2FNczjeiR8kz7HVYNo7mbO%2Flucca-import-users.jpg?alt=media&#x26;token=def532f0-ac68-46eb-b045-3eec0680cd19" alt=""><figcaption><p>Import Lucca users</p></figcaption></figure>

Users are synchronized via their professional email. It is therefore necessary that each collaborator in Lucca has their email entered, and unique.

On this page you have the possibility:

* to import all your collaborators into Cards, via the "Import all users" button
* to import collaborators individually.

Before proceeding with an import, you can modify options via the panel on the right:

* Notify created users: if "yes", then an email is sent to users whose account is created on Cards, so that they define their password or connect to the platform.
* Connection mode: allows you to choose which connection mode will be used by the imported accounts. This option allows you to choose "SSO" if you have configured the SSO connection on your Cards account.

In the listing, you can see the users already imported.

{% hint style="info" %}
Lucca limits the number of calls per minute to their app. If you are importing a large number of users at once, it is normal for it to take a little while.
{% endhint %}

Please note: if a user already exists on Cards (with the same email as a collaborator on Lucca), then the account is not created, but the connection is made between the Lucca collaborator and the Cards user.

### Import departments

By going to the "Synchro departments" tab, you will arrive on a page that lists your departments created in Lucca:

<figure><img src="https://4091897493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2QF90YKjb0mULStqbTyr%2Fuploads%2FyDU23EKmHx0tUAqejUnL%2Flucca-import-groups.jpg?alt=media&#x26;token=f189db2f-7f23-4a70-94e8-6756a8ae844e" alt=""><figcaption><p>Import Lucca departments</p></figcaption></figure>

As with the collaborators page, you can:

* Import all departments
* Import departments individually.

When a department is imported, a group with the same name is created in Cards, and all collaborators in the department are given a Cards account if they don't have one yet. Department collaborators are also automatically placed in the group on Cards.

Here too, you have the choice of notifying new users or not, and choosing their login method.

{% hint style="danger" %}
Please note that synchronization is not done automatically. If you add collaborators to Lucca (account creation, or addition to a department), you will need to return to Cards and restart the department synchronization.
{% endhint %}

### Synchronizing statistics

If you enable the option, you can upload training completion statistics by employee, directly into Lucca.

To do this, you must first configure the fields in Lucca.

#### Create a “Cards” section on your employee files

The first thing to do is to create, if you wish, a section on your employee files. It is in this section that the completion and score statistics will appear.

You can otherwise decide to display the statistics in an already existing section.

Follow these steps to create a section in Lucca:

1/ Log in to Lucca with an administrator account (it is necessary to have sufficient rights to modify the sections)

2/ Go to the "HR Base" solution

3/ Then in "Settings" > "HR File"

4/ The list of your sections then appears. You can click on the "Add a section" button.

5/ Name it "Cards", then click Ok

Your section then appears in the left menu, you can move this section if you wish.

#### Create the required fields for synchronization

We will now create the fields that will receive the statistics information. Here we offer you default values ​​and field names:

1/ Log in to Lucca with an administrator account (necessary to have sufficient rights to create custom fields)

2/ Go to the "HR Base" solution

3/ Then in "Settings" > "Data management"

4/ Here, click on the "New data" button. A window then appears:

<figure><img src="https://4091897493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2QF90YKjb0mULStqbTyr%2Fuploads%2FI8i5LH9e8uYM5qAFEDQX%2Fscreen-lucca-fields.jpg?alt=media&#x26;token=a9ea317c-dd29-4942-a572-fbc8f60f31be" alt=""><figcaption><p>Field creation screen on Lucca</p></figcaption></figure>

5/ In the first step, select the data type "Compound data"

6/ In the second step:

* enter the name of the data: "Formations Cards"
* enter the code "e\_formation"
* you will then add the following "subfields" (by clicking on "Add new data):
  * field #1:
    * name: Title of the training
    * code: e\_title
    * type: Text
  * field #2:
    * name: Link to the training
    * code: e\_link
    * type: Hyperlink
  * field #3:
    * name: Progress of the employee
    * code: e\_progress
    * type: Text
  * field #4:
    * name: Score of the employee
    * code: e\_score
    * type: Text
  * field #5:
    * name: Date of the last completion of the training
    * code: e\_last\_completion\_date
    * type: Text
* Check the "Allow multiple occurrences" box and use the "Training title" field as sort data.
* Click "Next".
* The 3rd and final step allows you to choose in which section you want to display the statistics fields:
  * Select the "Cards" section created previously (or another section if you wish)
  * Check the box in the 1st column "Editable"
* Validate by clicking on "Save".

Your fields are now ready on Lucca.

We can return to Cards to activate the synchronization. Go to the "Lucca" integration configuration page. In the right column, you can then activate the "Activate synchronization" option.

<figure><img src="https://4091897493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2QF90YKjb0mULStqbTyr%2Fuploads%2FNEULpPH5tnGHtxQE2v4v%2Flucca-config-fields.jpg?alt=media&#x26;token=da3d16af-151b-4550-a20b-8ff281568566" alt=""><figcaption><p>Synchronization Setup</p></figcaption></figure>

By activating the option, you will find the list of fields that we have configured on Lucca. If you have entered other "codes" for the fields, this is where you can enter them so that the link between Cards and Lucca works well. If you have used our default values, you do not have to enter the fields.

Click on "Save", and that's it ☺️

{% hint style="info" %}
Statistics synchronization is then done automatically, once a day (at night, French time).
{% endhint %}

By going to a collaborator's file (synchronized with Cards), you will then see the statistics come up:

<figure><img src="https://4091897493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2QF90YKjb0mULStqbTyr%2Fuploads%2FroJSqPyXkVsc2slk4z9J%2Flucca-cards-stats.jpg?alt=media&#x26;token=70d5878d-73d0-4729-9f1a-59021d3709e1" alt=""><figcaption><p>Statistics Cards available in Lucca</p></figcaption></figure>
