For Operator ID maintenance, my recommendation is to introduce Single Sign On as it is managed automatically by the system. However, depending on the business needs, sometimes you may have to manually maintain Operator ID in the Pega local database. If operators are not many, you can simply create it one by one, but what if you need to create hundreds or thousands? In this post, I will share how to build simple Operator ID bulk insert function from file (CSV or Excel). Please see attached for the tutorial.
For simplicity's sake, I will make the code minimum but you can add on more functionalities such as validation or error handling and make it fancier. This sample code covers the following use cases:
User can review the file contents on screen before inserting them to the database.
If a record is successfully inserted into the database, the row will disappear from the list.
If insert fails, user can identify which record didn't go well and the failure reason.
User can edit the failed record directly from screen and retry insert.
Operator ID bulk insert overview
Before building Operator ID bulk insert, the first step is to build file upload function. The file format can be either CSV or Excel, and it's your choice. I have posted How-to documents for both uploading CSV and Excel on Pega Community, so you can follow these steps.