Extract data from collection

Shweta

Active Member
Hi,

Please help me in how to extract SettingB information, i.e, only "345" from below data which i got in collection in different rows-

Settings:
SettingA: 123
SettingB: 345
SettingC: 567

Thanks
 

sahil_raina_91

Active Member
If I understood the problem correctly, here's what to do :-

Approach : Use a decision stage to confirm if the collection row contains SettingB. If yes, then extract last 3 characters, Else continue looping.
Code :
Loop Start
Function inside Decision Stage : InStr([Collection.ColumnName],"SettingB")>0
Connect Yes to Calculation Stage having : Right([Collection.ColumnName],3) and store in a data item
Connect No to Loop End

You will get the value in data item
Hopefully you will be able to understand this. I don't have access to Blue Prism, currently, to post an image.
 

Shweta

Active Member
Thanks, but this 345 is in second field, i.e its coming like as follows in collection:

Field 1: Field2
Setting1 123
Setting2 345
 

sahil_raina_91

Active Member
Thanks for explaining. Here is what needs to be updated :
Loop Start
Function inside Decision Stage : [Collection.Field1]="Setting2"
Connect Yes to Calculation Stage having : Right([Collection.Field2],3) and store in a data item
Connect No to Loop End

This approach is best suited for collection having low number of rows
 

bogapras

New Member
I suggest below approach.

1. filter out collection using collection manipulation - filter collection action; expression should be "Filed1 = SettingB".
2. if source collection has unique setting value then output will be 1 row collection, in this case use calculation stage to get Field2 value which is 345 in data item.
3. if source collection has multiple setting vaules then output collection may contain multiple rows, in this case extract Filed2 column from output collection using Collection manipulation - extract collection
 
Top