- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Email to a Friend
- Printer Friendly Page
- Report Inappropriate Content
Community blogs are written by members of the SS&C Blue Prism Community and represent the views of the author. For more information on Community Blogs, or to submit your own, see here.
Why write custom code for Blue Prism?
In a world where technological progress advances and low code is always suggested as the fastest and easiest solution, we often forget to consider the power of programming languages.
Using dlls and calling up specific namespaces can make our solution as performant as possible.
Just think of the simple drag-and-drop actions of Blue Prism itself, which are nothing more than code, which is why sometimes the Code solution is more stable and faster than the categorical use of standard actions. To give a practical example, we can look at a Loop action.
The iteration of a collection often takes a lot of time if the amount of data to be handled is very large, whereas the use of For Each within a custom code halves the time to get a useful result.
In many circumstances, code written in C# or Visual Basic has been (in my personal experience) the fastest and safest support solution. I’ve typically used it to:
- Extend existing objects.
- Add actions that were not present before.
- Manage new technologies sch as Microsoft App Registration, with API calls for SharePoint, Power BI, Outlook 365 and then Graph.
So, I’m a big fan of custom code! However, I would like to criticize the debugging of code within Blue Prism, as the compiler is often not precise in reporting errors. The method hints are static and not as dynamic as in a standard IDE, which lists all the methods of that object precisely and with a description. So – proceed with some caution.
Practical examples I’ve tried
Let’s showcase an actual example. In this object, I used global codes to be called in the individual code stages, implementing ad hoc classes in order to have debugging support that generates both Message Boxes (the simplest popup there is, but very useful for debugging a process as an alternative to the classic breakpoints) and an Input Dialog that populate variables of different types, generating output collections that collect the user's data.
For this solution, I have chosen the C# language and System.Windows.Forms.dll for form management, with the addition of other dlls and namespaces useful for certain special cases.
The Message Box
For the management of Message Boxes I opted for two different solutions:
- One static, with the popup closing only when the OK button is clicked.
- Another with an automatic closing timeout.
The latter can also used for small information messages during the run of a process. In my case, I also used it in the management of more complex Input Dialogues, to give information to the developer about what is happening (e.g. an error in entering a data table).
Input Dialogues
For each input dialogue I have implemented there is the possibility of giving a header to the form, a flag if it is to be on top, an informative message (e.g. enter in the following text box the value to be passed to the output) and then going more specific according to the type of data I expect to receive in output.
The simplest of all involves a textbox that accepts any type of data, which will be transformed into a text-type variable in Blue Prism.
Dialog inputs can also have a custom icon, passing the path to the file with the .ico extension chosen. If no file is passed, the object will recognize the Blue Prism installation path and use the .ico file in the folder.
Based on the premise just given, different Input Dialogues have been implemented for the different data types in Blue Prism.
- Numbers (with the addition of a tooltip indicating what the input box provides as input and also the decimal separator to be used):
In this case, any literal or special character keys will not be entered (except for the correct decimal separator based on the region of use) as there is a class in the global code, called from the numbers form class that checks the keys pressed by the user and allows or disallows their entry into the textbox. - Filepath:
One case that might occur is to have an Input Dialog that gives the possibility of selecting a file and populating a text variable with the full path to the file.
For this reason, a button has been implemented that gives the possibility of selecting the file to load. - File Image:
One of the Blue Prism types is the Image type and, inspired by the standard form of setting the image variable, the Export, View and Import buttons have been implemented, as well as a label that will be populated with the resolution of the loaded image.
By clicking the Import button and selecting the image, the Export and View buttons will be activated accordingly. Clicking the View button will give you a preview of the image file and the Export button will give you the option of exporting the image in the desired format.
- File Binary:
Again, this is another data type in Blue Prism, and the same approach applies as for File Image, with the addition of a label identifying the extension of the loaded file.
- Combo Box:
Sometimes we need to select a value from a list, then pass it as input.
In this example case we will pass a collection with three rows (1, 2, 3) and select the correct item, populating the output variable text.
- List:
In contrast to the combo box, we sometimes need to select several values from a list provided as input.
In this case, the Input Dialog List comes to the rescue, resulting in a collection with all the selected rows.
- Boolean
Another data type in Blue Prism is the flag data, which in programming language corresponds to the Boolean type. A form was therefore created here too, with radio buttons and the values True and False.
In this case, if no value is selected, a Message Box with a timeout of 2 seconds will be called, indicating that nothing was selected.
- Date
Further data from Blue Prism is the date type, so the form will have a calendar button where you can select from the correct date and a corresponding variable will be populated.
- Datetime
Further data from Blue Prism is the datetime type, so the form will have a calendar button where you can select from the correct date and the relative time. A corresponding variable will be populated. - Time
Same as the Date type, here we have the Time type. We create an input box where we can enter the desired time. In this case there is also a control on the values that can be changed by the arrows on the right - setting a range from 0 to 23 for hours, and from 0 to 59 for minutes and seconds. - TimeSpan
In Blue Prism, the data type TimeSpan is also present, so we have the possibility of choosing the days, hours, minutes and seconds that will populate the variable on Blue Prism.
- Password
We also have the Password type that will populate a variable of type password.
A dynamic form has also been implemented which relies on a collection in input with the type of data expected to be output.
In this case we have a Date, a Boolean, a Text and a TimeSpan.
Clicking on the Add button will add a row to the collection and consequently enable several buttons for managing the output collection.
Here we can see that the output collection has two rows. A Remove and Save button have been implemented, and the arrows allow the user to move from one row to another - displaying the values just entered on the screen.
The Save button is for modifying a row already inserted while the Remove button is for deleting rows from the output collection. Each Add, Remove or Save action is followed by a Message Box confirming that the action was completed.
When the Close button is clicked, the output collection is populated with the rows just inserted.
Should you start learning how to code?
As I said at the start, low code tools are fantastic for reusability and ease of use, but it’s important to keep in mind that even low code functionality was originally built using code! So, in my opinion, it’s good practice for everyone using Blue Prism to have a solid programming foundation – which will allow you to adapt to any situation.
If you’re looking to start learning a language like C#, Visual Basic or VBA (very useful for Excel!), YouTube is full of amazing and free courses. I also recommend making online communities like Stack Overflow your best friend.
In conclusion, the use of custom code in Blue Prism is feasible, and at the same time powerful, and can help us overcome even greater challenges with truly excellent solutions for the satisfaction of the end customer.
Thanks for reading, and please ask your questions in the comments below!
About The Author
Simone Toma
IT Process Automation Manager | RPA Expert | Certified in UiPath, Blue Prism, Automation Anywhere, WinAutomation With over a decade of experience in Robotic Process Automation (RPA), I currently serve as IT Process Automation Manager at CNH Industrial, where I lead strategic automation initiatives to streamline business operations and drive digital transformation. My journey in RPA began in 2013 as a developer, where I designed and implemented scalable automation solutions across various business functions. Over the years, I have developed deep expertise in leading RPA platforms including UiPath, Blue Prism, Automation Anywhere, and WinAutomation, delivering measurable improvements in efficiency, accuracy, and cost reduction. I hold professional certifications in all major RPA tools and have successfully led end-to-end automation projects, from opportunity assessment to deployment and governance. My work has contributed to significant operational savings and has empowered teams to focus on higher-value tasks. I am passionate about innovation, process optimization, and building automation strategies that align with business goals. My current focus is on expanding intelligent automation capabilities by integrating RPA with AI and analytics.