RPA | A2019 Read Config File Values| Automation Anywhere - Part-30
A2019 Read Config File values - Today in this article we will discuss about how to read configuration file values in A2019 Automation Anywhere.
Whenever we are assigned a process for development the most crucial aspect while developing a process is to store hard coded values or information in the config file so that it can be used throughout the process development so if there is any changes in the information can be changed at one place instead of changing it across various modules developed in the process. So there are various ways in which we can read configuration file values using A2019 Automation Anywhere. So in this article we will see two approaches through which we can read the values which are as follows:-
- Excel based approach.
- XML based approach.
- Manually open the excel file. Create the necessary parameters such as folder path, URL, Processed path, Output path etc.
- Open the A2019 Automation Anywhere.
- Go to Bots->My Bots then click on create bot and give the bot name and click on create and edit.
- From the Actions tab, select the CSV/TXT package then select the open command and in the properties section give the session name, then browse the file from the required folder location and then check the sheet contains a header checkbox and select comma delimiter in the delimiter option and UTF-8 as the Encoding option.
- Drag and drop the Read command and in the properties section give the same session name as passed in the open command and store the output in the table variable data type.
- Now loop through all the rows of the table variable and check if the row contains the key. If key exists then assign the output to a string variable data type and so on for all the required variables that we created in the csv files.
- Once this is done drag and drop the close command of CSV/TXT package action and pass in the session name that we passed initially which will be used to close the csv file opened during the process creation.
- First of all start the xml session by dragging and dropping start session under the A2019 xml package.
- Then drag and drop the execute xpath function to access the values. For example, to access folder path the xpath expression that would be written is as given below: /config/environment[@id='EnvDev']/FolderPath
- Then repeat the same command to access or to fetch other values from the config file.
- Lastly, end the xml session by dragging and dropping the End Session action by passing in the same session name passed in the start session of the xml package.
Good job 👍
ReplyDeleteExcellent 👌
ReplyDeleteThis is really informative blog, I have to thank for your efforts. Waiting for more post like this.
ReplyDeleteAutomation Training Institute in Chennai
Automation Anywhere course in Chennai
Automation Anywhere course
Online Openspan Training