You can configure Perk to automatically import master data for expense and invoice processing via SFTP. To upload the import files, you need to:
You can import these object types using the Perk standard import format (CSV):
Once you have done the initial configuration of the SFTP connection to allow access to the Perk SFTP server, you need to determine how Perk should process any files uploaded to the secure directory. You set up a configuration for each data object type separately. Only active configurations are considered. If you set the configuration as inactive, Perk skips these files during the import job.
Whenever a new file is added to the SFTP server, Perk checks to see whether there is an active configuration that determines how to process it. If an active configuration is found, the file is immediately processed, uploaded, and then moved to the archive folder when successfully processed. If no active configuration is found, the file is left unprocessed on the server.
Note: Please note that the SFTP server is rebuilt daily at approximately 20h00 UTC. This process takes about 5 minutes. It may mean that you are unable to connect during this time.
Caution: This feature does not support any existing configuration for Perk file imports or custom import files. If you need to change the existing import configuration for Perk standard file formats or the import configuration for custom file formats, reach out to Perk.
Adding an SFTP import configuration
You set up the import configuration in Settings > Developer tools > Spend tools, SFTP import tab.
Note: You must have previously set up the SFTP connection before you can set up the import configuration. Bear in mind that setting up the initial SFTP connection takes up to 24 hours. To specify the configuration for a specific data object type, click + Add SFTP import.
Source file
You need to determine the folder where the file is located and the pattern of the file name.
In Folder, select the source folder where you upload the file to be imported. The configuration retrieves the names of all sub-folders of the to_yokoy folder in the SFTP server.
In File name pattern, enter a RegEx expression that can be used to identify the file name. For example, use categories[.]csv for files named categories.csv. You can also use more complex naming patterns.
Example of accepted patterns:
categoriescategories.csvcategories[.]csvcategories_.*csvcategory_import_company1_\d{8}[.]csv
Bear in mind that the pattern must unique within the organization. If you set up more than one configuration with a pattern that could be equally used to identify the same file, then Perk is unable to determine which configuration should be used to process the files and aborts the process.
For example, if you set up two configurations to use a file name pattern of category.*csv and category[.]csv, Perk is unable to determine which one to use to import a file named category.csv.
While files are processed whenever they are added to the SFTP secure directory, it is recommended that the file name must be unique between uploads, adding a timestamp or a date to ensure traceability.
Tip: Test your RegEx expression using regex101.com to ensure the file pattern is correct.
Import job
In Data collection type, select the type of data object included in the file. You can choose from:
- Expense categories
- Invoice categories (if Invoice processing is enabled)
- Suppliers (if Invoice processing is enabled)
You can download an example of the import file to be used in the form.
Company mapping
Finally, before you can save the configuration, you need to determine the company or companies where the data is imported.
If the file contains data for one company or you want to import the same data into multiple companies, i.e. to create the same cost objects or categories in all selected companies, select the corresponding companies in the Company field.
If the file contains data for multiple companies in a single file (i.e. separate data for separate companies), then you should turn on Enable data split.
In this case, you need to specify:
-
Column name for data split: enter the name of the column that Perk can use to determine which company the data applies to, e.g.
companyName -
Split value: specify the value indicated in the file that identifies the company, e.g.
companyES. - Company: select the Perk company to be associated with the split value, e.g. Company A - Spanish entity.
You can add as many values as required to cover all requirements. Any rows that do not contain any value or contain a value that hasn’t been specified and mapped to a company in the configuration are ignored.
Once you have entered all mandatory fields, you can either:
- Save as inactive: the configuration is kept but not taken into account when the file is uploaded.
- Save as active: the configuration is kept and used by Perk to process the files uploaded to the SFTP server.
Viewing and editing SFTP configurations
In the SFTP import tab overview, you can see all configurations that have been set up for the organization.
The table displays the companies impacted by the import, the type of data, the file name pattern used, where the file should be uploaded within the SFTP server and the last time the configuration was modified.
You can change any of the settings by clicking Edit. You can activate or deactivate any file imports as required by clicking the toggle switch in the Status column.
Bear in mind when deactivating or activating a configuration, the configuration is only considered for newly uploaded files. If there are unprocessed files already on the SFTP server, they will not be processed. You must download and upload the files again for it to trigger the import process.