cancel
Showing results for 
Search instead for 
Did you mean: 

#BPTechTips - Multiples Environment variables

EmersonF
MVP

Hello everyone, everything good?
It may seem like a simple tip, but it helped me a lot in extensive processes.

Before approaching the solution I would like to mention the importance of using environment variables in your automations, thus reducing the need to change the code many times just to change a path of a file that is flat inside the stream.

Come on..
I recently worked on a huge process and it had about 30 different folder paths, so basically I needed to have 30 environment variables and that would make it very cluttered and hard to find a path in between 30 variables, so what was the solution?

I created a JSON Structure with two "columns" ID_Name and Path

[
   {
      "ID_Name":"FOLDER XYZ",
      "Path":"PATH HERE"
   },
   {
      "ID_Name":"FOLDER XPTO",
      "Path":"PATH HERE"
   }
]

And with the action JSON to Collection (skipping JArray) of the VBO JSON Manipulate I was able to convert this JSON to collection.
So like all paths in a collection, I created a filter collection stage, whenever I needed a path, I passed the ID_Name "FOLDER XYZ" as in the example above in the filter and returned a single path that was what I needed with this to be able to have one greater degree of organization within my process without needing to get lost among so many environment variables and by using environment variables I allow the paths to be changed without the need to change anything within my robotic flow.

Link to VBO
JSFiddle



#BPTechTips



------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil
1 BEST ANSWER

Helpful Answers

Oh yes! @Tushar Varshney I didn't address this aspect because I believe that each operation must have governance and risk management, for example there is a team dedicated to X automations so all support is given by this team and there is a cataloging and formalization of everything that was done, requiring evidence that in fact the change was successful and automation works normally.

On the part of the flow, even with this approach of "Collection" and filtering, there is a whole logic of validation and verification, such as validating if the path exists and validating if the file exists.

If something is wrong in the JSON structure, an exception will be thrown informing the error and the support team will take action.​

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

View answer in original post

5 REPLIES 5

TusharVarshney
Level 5
appreciate this approach however this may increase a risk probability if support team is updating the value very frequently. they may end up interrupting the JSON format. This just need an additional layer of precaution.

------------------------------
Tushar Varshney
Senior Consultant - Intelligent Automation
Ernst & Young India
+91-9880188366
------------------------------
Tushar Varshney Senior Consultant - Intelligent Automation Ernst & Young India +91-9880188366

Oh yes! @Tushar Varshney I didn't address this aspect because I believe that each operation must have governance and risk management, for example there is a team dedicated to X automations so all support is given by this team and there is a cataloging and formalization of everything that was done, requiring evidence that in fact the change was successful and automation works normally.

On the part of the flow, even with this approach of "Collection" and filtering, there is a whole logic of validation and verification, such as validating if the path exists and validating if the file exists.

If something is wrong in the JSON structure, an exception will be thrown informing the error and the support team will take action.​

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

Hi, Emerson,

why don't you use excel config file where you can have a label and the value and through transformation of collection you can get whatever you need. Excel is structured, easy to modify, simple to see.

We use it in our processes as the first step to read everything from excel and avoid using extensive environment variables as it is very difficult to manage. If you have a separate excel file for each process and in excel you can even have three worksheets - DEV, TEST, PROD - you have all your configuration parameters in one place for all environments.

Regards,

Zdenek

------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------

Hi, @Zdeněk Kabátek
I appreciate your answer, and I found it interesting, could you tell me a little about how you manage these files, permissions, etc.. ​​​

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

This sounds better approach. I too use a similar structure in the excel sheet but I use a single sheet with 3 separate columns for Dev, UAT, and Prod. So as per one of my first line value called Environment = UAT/Dev/Prod , excel will pick up the value from that particular column. This can be achieved with simple excel formula.

------------------------------
Thanks & Regards,
Tejaskumar Darji
Sr. RPA Consultant-Automation Developer
------------------------------