Reading and splitting values from a Config file

soonerorlater

New Member
Hi,

We are using a configuration file instead of environment variables.
I am able to read all lines using Utility-File Management, storing into a collection.

I am trying to read the line and split the lines using String - Split Text. But the action needs a input parameter called 'Collection Field Name'.

Can someone please explain what value should be provided for this input?
 

VJR

Well-Known Member
Hi soonerorlater,

The 'Collection Field Name' is the name of the column in the Output collection coming from the Split Text action.

- Suppose your Input string is "string1=string2=string3"
- If the Input params are given as below:
1521532539781.png

In the Output tab give the Collection name eg; Split Values

- Create a new column in the collection with the same name as mentioned above - "Key"

1521532496418.png

- After running the process the Current Values tab of the collection will be as the below.
The Input string has been split into 3 different rows of the output collection with the split character as "=".

This is to accommodate as many number of split characers in the input string.

1521532677138.png
 

rpame

New Member
Can you please help me how to create configuration file in BP instead of using environment variables.
You could do this in just more than one way, you could save all the data in a excel file or as an csv and then take in the data as a collection.,
 

rpame

New Member
Please help me with any example,specially screenshots if u have any

CONFIG FILE

So the first thing is to make a config excel file (or CSV). The excel could look like this:
View attachment config.PNG

PROCESS TO GET DATA

Now its time to get the data and use it some how, so here it could be a idea to add this to a collection and then read
from the collection.

INSTANCE

First we need to create an excel instance, using the MS Excel VBO:
View attachment create instanceCapture.PNG

OPEN WORKBOOK

Then we need to open the workbook:
View attachment openworkbookCapture.PNG
View attachment _openworkbookCapture.PNG

READ DATA TO COLLECTION
And now we will save this to a collection:
View attachment savetocollectionCapture.PNG

HANDLE COLLECTION DATA

Now when we have run the process and the data is in the collection now we can read from the collection to look at the data.
So how do we make this magic happen, here is how:

Collection is looking like this:
View attachment collectiondataCapture.PNG

Next thing is now to loop the collection for example and add the result to a data item or just read directly from the collection and handle it how you like:
View attachment processCapture.PNG
 
Top