Bulk Importing of users initial PINs

Christopher Dakin

If you are using PIN authentication, users will need to log on to My Account in order to set their own PINs.

You may wish to set an initial PIN for each user instead to help them get started quicker.

This article shows how you can use the Automations feature to perform a bulk set of PINs by using a CSV file.


Create the CSV file

In Excel or similar, first you need to create the CSV file containing your list of users and what PINs you want to set.

The file can be created with or without a header line. For example, we have 10 users listed in this file.


Make a note of the number of columns in the file (2) and also the Quote Character (used when a value contains special characters) and the Delimiter Character (which separates your values).

For Excel our defaults for Quote and Delimiter will work so you do not need to discover these.


Create the Import CSV automation task

Now we need to set up the task to import the CSV that has been created.

Click on Automations under Business Rules on the left menu, then click Create.


On the Create Automation page, give this automation a name, such as Create PINs from CSV.

For the task, start typing Import CSV and select it from the list when it becomes visible.

This will open up the configuration for the import. On the Options tab, enter the Quote and Delimiter characters if they differ from the defaults (Excel CSV files do not need any changes).


Click the Source tab, then set the Source dropdown to UPLOAD.

Next to Source Upload, click the Choose file button then select your CSV file. This will upload your file to the server.

For Columns, enter the number of columns of the file that you noted earlier (2).

Set Contains Headers to the correct value for your file.


As this automation will be a one time task, we do not need to configure any of the other tabs, so at this point you can click the Create button.


Create the Import PIN task

Now we have the import task, we need to tell LogonBox what to do with the file, so we will chain this task to another automation.

On the Automations page, click the + symbol next to the Import task that was just created.

This will show this task as a module. Click the  icon in that module to chain a new automation off this one.


You will now see a new Create Automation page that has an Event of Import CSV already filled out for you.

Give this new automation a name, for example Import PINs, then set the Triggers On to Success (we only want this to run if the Import CSV task completed).

For Triggers Task, start typing Import PIN then select it from the list when it appears. This opens up the settings for that task.


We won't be setting any conditions on this trigger, so click on the PIN tab.

The Username is the first column in our example file. Click the ${} button to the right of the username field and select the ${attr.column1} attribute.

Likewise the PIN is column two, so select ${attr.column2}.

Click Create to save the configuration.


Your Automation is now ready to run.


Running the import

Now we have the automation set up (and we didn't set a schedule), we now have to run the task.

To do this, click on the green gears icon and select Run Now.


The Automation will now run.

Give the automation a few minutes to run, then take a look at the Audit Log.

You should see Import CSV, Set PIN and Import PIN Completed events for each user in your CSV file