Add column values in run time for multiple filter conditions in collections

Need you help/inputs for below scenario.

I have a collection with 2K records and I need to filter that collection based on the business rules.

For example: Collection A contains 4 columns i.e P,A,C,E and also has data(values) in it.

I have filter rules like below

if P column = "D" and A column = "Unassigned" than add one more column to collection A (i.e Type col)and add value as TypeD .

if P column = "R" and A column = "Unassigned" and E column = "EVC" than add value as TypeR to that new added column i.e Type.... etc like this i have 5 to 6 business rules (each business rule picks different col so i cant use filter action).


So my thought on this is

1) For adding column on existing collection i.e A by using "Append Field " Action in collection manipulation

2)Using choice stage i will give multiple decisions and sort the data and after that I m using set collection field to update the data. But The conditions which I am giving are not working.
Please help me to use this choice stage or Please give me suggestions on different method of approach. Thank you!
 

Sukesh Kumaru

Active Member
Hello,

For the above scenario you can go ahead with this approach :

i.e by using Data-OLEDB VBO

First write a query for checking the condition and then add extra columns as mentioned.

Good Luck.
 
Hello,

For the above scenario you can go ahead with this approach :

i.e by using Data-OLEDB VBO

First write a query for checking the condition and then add extra columns as mentioned.

Good Luck.

I cant use DB for this. I had to use defult VBOs , collections and stages.
May be I can go for code stage if requires.
 
I am using below conditions, It is not throwing any error as well as any correct result.
Its just setting value in wrong place.

1st condition
[PON_Table.ACT] = "D" AND [PON_Table.ACTION] = "Unassigned" AND [PON_Table.STATUS]= "PNDORDRW"

2nd condition
[PON_Table.ACT] = "R" AND [PON_Table.ACTION] = "Unassigned" AND [PON_Table.STATUS]= "PNDORDRW"

3rd condition
[PON_Table.EVCI] = "EC" AND [PON_Table.ACTION] = "Unassigned" AND [PON_Table.SRC]= "B" AND [PON.MKT] = " "

After choice stage i m using append text action to append the new field value. (Output also using same collection Result)
View attachment 1544508336417.png
 
Last edited:

VJR

Well-Known Member
I am using below conditions, It is not throwing any error as well as any correct result.
Its just setting value in wrong place.

1st condition
[PON_Table.ACT] = "D" AND [PON_Table.ACTION] = "Unassigned" AND [PON_Table.STATUS]= "PNDORDRW"

2nd condition
[PON_Table.ACT] = "R" AND [PON_Table.ACTION] = "Unassigned" AND [PON_Table.STATUS]= "PNDORDRW"

3rd condition
[PON_Table.EVCI] = "EC" AND [PON_Table.ACTION] = "Unassigned" AND [PON_Table.SRC]= "B" AND [PON.MKT] = " "

After choice stage i m using append text action to append the new field value. (Output also using same collection Result)
View attachment 2769
Is it working when you put just one condition in a Decision stage and set the collection column with the desired value?
 

VJR

Well-Known Member
yes its working when i use decision stage
-So then drag a Choice stage
-Open the first box of the choice and start adding these three statements using the Add button.
- As you add each of them (3 in your above case), you will see 3 more small dots/bubbles added between the start and the end choice stage. Take the first small dot and connect it to a Calc stage where you will provide the Calc expression for setting the data based on the first choice condition. Likewise need to do the same for the other two.
From the Calc stage connect it to the Loop end stage or wherever else you need it.
Do take a look at the Blue Prism Choice stage here.
 
Top