How to get a value from collection variable column?

Dav3D

New Member
Hi, I would like to get a value from a collection column but this column can be a variable that is input from a data item, something like:
[CollectionA.ColumnXX]. where XX comes from a Data Item.
I tried concatentation in a Calculation Expression but it bring just a text value:

"[CollectionA.Column"&[XX]&"]"

Thanks
 

VJR

Well-Known Member
Hi Dav3D,

There doesn't appear to be a functionality via Blue Prism to make use of concatenated column headers.
As an alternative, you can first get all the collection fields (which returns another collection) and then using a concatenated Text compare you can get the value of the desired column if they both (concatenated column header and the actual collection column) match.
Post #2 in below link will give a guideline on how to read and loop through the collection fields.

http://rpaforum.net/threads/loop-th...tion-without-using-column-name.1196/post-3688
Do post back if it is not clear or if you are looking to do something else.
 

Dav3D

New Member
Hi Dav3D,

There doesn't appear to be a functionality via Blue Prism to make use of concatenated column headers.
As an alternative, you can first get all the collection fields (which returns another collection) and then using a concatenated Text compare you can get the value of the desired column if they both (concatenated column header and the actual collection column) match.
Post #2 in below link will give a guideline on how to read and loop through the collection fields.

http://rpaforum.net/threads/loop-th...tion-without-using-column-name.1196/post-3688
Do post back if it is not clear or if you are looking to do something else.

Thanks for the prompt response. Although this might work, I do not want to hardcode field names, as this is coming from a report that sometimes changes its titles.
Based on that the other idea I had was to traspose each row into a new collection with one column and the iterate by row until the desired number, but this does not seem very elegant.
Any other ideas, welcome.
 

VJR

Well-Known Member
Hi Dav3D,

Nowhere in the diagram on the link is a hard coded field name. Maybe you have a different requirement or I did not fully understand yours.
If you would like to explore more can you elaborate more details of how your process, collection is and what are you looking from it.
 

VJR

Well-Known Member
Something like ...

Collection 1:
Column A | Column B | Column C

A, B and C are coming from somewhere else (report?) and from your post it appears that they are in a data item.

If you can explain something like this that would give a better idea.
 

Dav3D

New Member
Something like ...

Collection 1:
Column A | Column B | Column C

A, B and C are coming from somewhere else (report?) and from your post it appears that they are in a data item.

If you can explain something like this that would give a better idea.

Actually I got it wrong the first time, your solution is not hard coding :)
Now to provide more perspective, I have a collection A with n number of rows, I search on a fixed column in CollA for a value in another Collection B, if I find it, I need to retrieve the value on a column X in that row. The complexity is that X can change depending on some scenarios or even report layout changes.
I believe I can reapply your solution by making the counter to match the parameter number I wanted to initially use and stop on [Collection Fields.Field Name] and then use that value always during the row search on CollA.
 
Top