Hi Harish,
As per my experience, you can have a variety of configuration file formats. It also depends from client to client and organization to organization. I will give few examples from my past clients. I have come across automations where clients have used Excel files, XML files, JSON files, Text Files as well as SQL Server Database to create a separate configuration table.
Excel File Configuration:
When we talk about excel configuration, you can probably have different sheets fro 'DEV', 'QA' and 'PROD' with three columns in each one of them such as Name, Value and Description. This configuration file path and the sheet which needs to be accessed can be stored in the Blue Prism Environment Variable section. This way even let say you process has 70 configurable variables to manage, the complexity on your environment variable end is way less as you just have to maintain the file path and sheet name properly.
For fetching the values, you can probably create a collection out of these columns and use filter collection action to fetch any desired variable. An alternate approach would be to create a custom code stage that can transpose the Name and Value column in such a way that the names of the collection become the headers and the values for each of these names become a value in a single row. This way you can treat your collection as a dictionary variable: [Collection_Name.Name] will give you that specific value only.
XML Files:
You can create an XML file with a node structure such as the following:
<config>
<env name="DEV">
<name_1>value_1</name_1>
<name_2>value_2</name_2>
<name_3>value_3</name_3>
</env>
<env name="QA">
<name_1>value_1</name_1>
<name_2>value_2</name_2>
<name_3>value_3</name_3>
</env>
<env name="PROD">
<name_1>value_1</name_1>
<name_2>value_2</name_2>
<name_3>value_3</name_3>
</env>
</config>
You can go ahead and parse this structure to get all the related values in a collection by using the XPath Expression along with the Get Attribute action from Blue Prism to get the elements under the exact environment name which you can get from your Environment Variable.
JSON File:
You can use a sample JSON file as well to create an array of values which can be parsed directly into a datatable using JSON To Collection action.
[
{"Name_1":"Value_1"},
{"Name_2":"Value_2"},
{"Name_3":"Value_3"}
]
Text File:
You can even create a sample text file where every file might consist of a separator in between the names and values in multiple lines. You can read the lines into a collection and then by using a split action for each of that line you can populate an already created collection with two columns : "Name" and "Value" with the relevant data from each line. For example:
Name_1=Value_1
Name_2=Value_2
Name_3=Value_3
Database Tables: You can create a separated SQL table as well with the same structure as shown in excel files, have three columns : Name, Value and Description. Make a SQL Query from Blue Prism to get Name and Value into your collection.
Conclusion is that no matter what approach you take, think of having a collection data with two columns where one can be referred as a key and another as a value and from there you will be able to fetch it using either filter action or by using a custom transpose which can generate a single row collection with names as headers and values as the corresponding field values for that collection.
------------------------------
Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blueprism 6x Certified Professional
Website:
https://devneet.github.io/Email: devneetmohanty07@gmail.com
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.