V1 Help
SmartConnect

Information

What is SmartConnect?
Compatibility

Downloads

SmartConnect
SmartExtractPickup
SmartExtractVendorImport
SmartApprove
V1FilterMapMaintenance
V1HouseKeepingManagement
V1Logs2Email
V1UpdateService

Documentation

SmartConnect
SmartExtractPickup
SmartExtractVendorImport
SmartApprove
V1FilterMapMaintenance
V1HouseKeepingManagement
V1Logs2Email
V1UpdateService

Administration

Logs
Postman Collections
Tweaks

Enhancement

Request an Enhancement

Support

Contact Support
  1. Home > Documentation > SmartExtractVendorImport

SmartExtractVendorImport


Pre-Requisites


The following core software must be installed / licensed for before applying SmartExtractVendorImport:

Mandatory:

• DbLogin
• DbArchive
• DbForm
• The V1 SmartSuite
• V1Integration Server
• V1WebPortal
• SmartExtract
• SmartMail (including SmartMailSend)
• DbLogin Admin Console
• SmartConnect
• Vault


Assumptions


For the purposes of this document, the following assumptions are made, change as appropriate to your installation:

• The V1 directory is C:\V1Home
• Your SmartExtract queues have been created and you know the email addresses they have been assigned (for testing purposes)


Create a DbLogin Import User


Q: Why am I doing this?
A: A dedicated DbLogin user needs to be created, its sole job is to authenticate and permit csv files to be imported into SmartExtract i.e. it’s not a physical person, just a means import files into a queue.

1. Log in to the SmartSuite as an administrative user
2. Click on User Management > Manage users
3. Click on Add user
4. User Type = DbLogin User
5. User name = SEVI_IMPORT
6. User level = User
7. Password = Choose a password (take note of it, you’ll need it later in this document)
8. Role = admin
9. Ensure Must Change Password is UN-ticked
10. Click Save

Your Import User is now ready to be used in conjunction with SmartExtractVendorImport.

Un-Compress SmartExtractVendorImport


From the zip file you’ve downloaded, un-compress in to your C:\V1Home directory, so you end up with:

C:\V1Home\SmartExtractVendorImport

Which contains the def and all the files required.


Configure Vault


Using your browser of choice, connect to the V1 Server and navigate to http://localhost:8200
Where promoted, enter the Token

1. Click Sign In
2. Click kv
3. Click Create secret
4. Enter the Path for this secret to be SMARTEXTRACT_VENDORIMPORT (NOTE: This MUST be in UPPERCASE)
5. Toggle the JSON button so you see a black Secret data screen with blank values
6. Navigate to the C:\V1Home\SmartExtractVendorImport directory
7. Open the Vault_settings.json file in your text editor of choice and copy the contents to your clipboard
8. Paste it into the Secret data screen
9. Click Save
10. Un-toggle the JSON button

You have now imported all the settings required and they contain sample values, the table below explains what each of them represent, click Edit secret to change them and Save when satisfied they are correct.

Key Values Explanation
AUTOIMPORT 1
0
1 means activate the auto import of CSV Files when found
0 means don't auto import them (this is useful whilst testing for instance)
CSV_IMPORT_DIR C:\V1Home\SmartExtractVendorImport\CSV_IMPORT The path on disk of the CSV_IMPORT dir. Any CSV File found in this dir will be imported regardless of where it comes from
EMAILONFAILURE 1
0
1 Means activate emailing a user to inform them of a failure to import a CSV File into SmartExtract
0 Means de-activate
EMAILONFAILURE_ADDRESS myuser@mycompany.com If EMAILONFAILURE = 1 set the email address to be informed of failures
ERP X3 Tied to the LOOKUP secret, the stated ERP into which a lookup is made to obtain the Supplier and BU information
IMPORTONLYQUEUE 1
0
1 means activate the ability to select specific SmartExtract queues to import your Supplier and BU data in to.
0 means do not activate, thereby importing all data in to all queues
IMPORTONLYQUEUENAMES 19

or

3|19|23
If IMPORTONLYQUEUE=1, the numerical representation of the queue(s) you want to import Supplier and BU data in to.
To find this, click on Manage Queue in SmartExtract and note the number at the end of the URL.
Where more than one queue, seperate them with a pipe symbol.
LOOKUP 1
0
1 means you are using an include to get the CSV details from the ERP value specified.
0 means you are not doing a lookup / have an include
NISURL http://localhost:5002/api The base NIS URL. NOTE: Browsing to this should resolve to a list of API’s
QUERYPASSWORD Passw0rd123 The password of the DbLogin user SEVI_IMPORT you created in the earlier chapter
QUERYUSER SEVI_IMPORT The DbLogin user you created in the earlier chapter specifically for the purposes of importing CSV Files
V1_DIR C:\V1Home The V1Home dir


Configure SmartExtractVendorImport poll frequency


A simple .ini file dictates how often Vendor details are imported.
This value is in seconds.

In File Explorer, navigate to C:\V1Home\SmartExtractVendorImport
Using a suitable text editor, edit SmartExtractVendorImport.ini
Take note of the following value, the number in red is how often it will trigger:

cmd1-wait-time=3600

Some common values:

cmd1-wait-time=60
Once a minute

cmd1-wait-time=3600
Once an hour

cmd1-wait-time=86400
Once a day

When changed, save the file.

Install the SmartExtractVendorImport service


The final step is to install the SmartExtractVendorImport service which will fire based on the cmd1-wait-time set in the previous chapter.

NOTE: The first time it runs / restarts means the time will double, i.e.

cmd1-wait-time=3600
Means it runs once an hour, it will only kick in after 2 hours having restarted, then once an hour from then on.

It does this as it has to check it’s been configured properly and run a cycle before triggering for the first time.

C:\V1Home\SmartExtractVendorImport\CSV_IMPORT
Any CSV file that finds it's way in here from whatever means (whether a DB export, email attachment or manual file drop) and is of the right format for the API will be uploaded in to all SmartExtract queues.

C:\V1Home\SmartExtractVendorImport\FAILED
Any CSV file that finds it's way in here from whatever means and is of the right format for the API will be uploaded in to all SmartExtract queues.

C:\V1Home\SmartExtractVendorImport\TEMP
A temporary storage area for lookup payloads and html alert files.

C:\V1Home\SmartExtractVendorImport\INCLUDES
Where matcing the ERP flag in Vault, a def file that retrieves the required information for the CSV file, creates it and copies it into the CSV_IMPORT dir C:\V1Home\SmartExtractVendorImport\PROCESSED
A copy of all successfully imported CSV files

1. Edit the SmartExtractVendorImport.ini and verify the paths
2. Double click on !Install_SmartExtractVendorImport.bat
3. Double click on !Start_SmartExtractVendorImport.bat
4. Open services and check it’s there and started
5. Wait double your chosen time in seconds, then check C:\V1Home\logs\SmartExtractVendorImport.log exists
6. Open it
7. Check for any issues, if all is well, close it


How to Test Manually


If you have a requirement to 'run it right now' rather than waiting for a tick, you can test it manually as below:

1. Open a CMD prompt and CD to the C:\V1Home\DbForm\bin directory
2. Copy and paste the below (all on one line) into the CMD prompt

dbform.exe -l C:\V1Home\logs\SmartExtractVendorImport.log C:\V1Home\SmartExtractVendorImport\SmartExtractVendorImport.def c:\V1Home\SmartExtractVendorImport\SmartExtractVendorImport.def

3. Press Enter
4. You will see in the foreground all activity and it will run as if it had been ran as the service, but straight away. Check the log for any issues.