Importing employees and roles using the AFAS web service

Importing employees and roles using the AFAS web service

In organizations with a large number of employees, onboarding and offboarding happen regularly. If employees are maintained in AFAS, they can be imported into Spend Cloud via the web service. This saves a lot of manual work.
You can read more about the basics of importing employees into Spend Cloud here. In the article you are reading now, we explain how this works specifically in combination with AFAS.

Idea
You can find more information about loading GetConnectors in AFAS in this article.

Importing employees

GetConnectors in AFAS make it possible to retrieve specific data. To import employees, the ProActive_employees GetConnector can be loaded in AFAS. You can download it here. 

Once the GetConnector has been loaded, make sure to add a built-in filter in AFAS so that only the relevant employees are imported into Spend Cloud. On this page on the AFAS website, you can read how to set up this filter. Use the filter to ensure that only employees are included who have:

  • An AFAS username

  • An email address

  • A last name

  • No end date, or an end date in the future

Make sure that employees with an end date in the past are not included.

In addition, configure the filter so that employees who accidentally appear multiple times are included only once.

After the GetConnector has been loaded and the filter has been set up correctly, you need to create an import definition. Go to Application Management / General / Import Definitions, click Add, and give it a logical name, for example “Employees from AFAS”.

For Input type, choose AFAS GetConnector. At the bottom, enter the name of the connector: ProActive_employees. For Import type, select Employees.



For “Deactivate before import”, choose “Yes”. All employee accounts that are not included in the import will be set to inactive. This way, the employee list in Spend Cloud remains up to date.

Click Save.

Now, in the overview, click the gear icons next to the import definition to further configure the import:

Now indicate the fields from which Spend Cloud can retrieve values via the GetConnector:


In AFAS, it often happens that a specific username is not used for an employee, but rather a number (as in the example above) or an email address. In the latter case, the email address must be provided twice via the GetConnector. In the field layout, this looks like this:


The employee account then appears like this in Spend Cloud:


Importing Roles

It is also possible to import roles from AFAS into Spend Cloud using the web service. When doing this, it will still be possible to manually add roles.

Creating a Connector in AFAS

To import roles, a Connector must be created in AFAS containing three values:

  • the name of the organizational unit

  • the username of the employee

  • the code of the job profile

The first step in configuring employee roles in Spend Cloud is to determine whether it is feasible to standardize the roles using job profiles.

Notes
The data above must exactly match how it is registered in Spend Cloud. For example, the job profile code in Spend Cloud must match the code received from AFAS.

AFAS provides official documentation describing how to use and configure connectors and app connectors, including background information on linking external software via Get/Update Connectors. Since creating the connector must be done within AFAS, we do not go into much detail about this in our documentation. For assistance, we recommend contacting AFAS or the person in your organization responsible for managing AFAS.

Import Definition in Spend Cloud

Once the connector has been created in AFAS, you can create an import definition in Spend Cloud. In Application Management / General / Import Definitions, click Add and give it a logical name, for example, "Roles from AFAS." For Input Type, select AFAS GetConnector. At the bottom, enter the name of the Connector as created in AFAS. For Import Type, choose Roles based on Job Profile. Click Save.

Next, click the gear icon next to the import definition to further define the import:


You will now indicate where Spend Cloud can read the required values. The values you select here should be based on how you have set up the GetConnector in AFAS. Here is an example of how this might look:


Select the correct values and click 'Save.' You can now run the first import. Check whether the roles appear correctly in Spend Cloud.

Idea
The option 'Deactivate for Import' is not available for this import. If you select Yes for this field, all data in Spend Cloud that is not included in the import file or via the Webservice will be set to inactive. If this option were enabled and something went wrong during the role import, all existing roles in Spend Cloud would be deactivated. This would also mean that users could no longer perform any actions. Because this is very risky, the option is not available.

Error Messages When Importing Roles

Even if the import works, you may still encounter an error message during the import. Here we explain two possible messages.

"Action Messages: 'Some required fields are missing on certain rows. The rows with errors have been ignored.'"
Below this message, you will see the values involved. An example is when a value does not exist or appears more than once. In such cases, Spend Cloud does not know which value to use. For instance, if AFAS provides an organizational unit that does not exist in Spend Cloud, the software will not know where to "assign" the role.

"Action Messages: 'Some required fields are missing on certain rows. The rows with errors have been ignored.'"
In this case, the employee already has a conflicting role on the organizational unit for which the new role is being provided. For this reason, the new role cannot be imported.

    • Related Articles

    • Configuration settings for import/export

      In the menu section "Configuration Settings / Import/Export," you will find settings that apply to imports and exports from the Spend Cloud. For more information about configuration settings, refer to this article. Make sure you understand what each ...
    • AFAS – Switching to renewed export logic

      For the Invoice Processing module, Spend Cloud has developed a renewed export logic for AFAS (997 - Customisable - Afas). The new AFAS export works with the latest technologies via the AFAS REST API. This ensures better performance, easier ...
    • Retrieving scans externally

      Scans can be retrieved by constructing a link (URL). This link has a limited validity period to minimize the risk of unauthorized access to the scans. The URL must be constructed in the following format: ...
    • Merchant category code (MCC)

      These days, many processes can be automated, including the reconciliation of card expenses. It's possible to filter expenses made with Spend Cloud cards and bunq cards using Merchant Category Codes (MCC). This allows specific types of costs to be ...