cancel
Showing results for 
Search instead for 
Did you mean: 

Collection - Column order

PvD_SE
Level 12
Hi,

I added a column (Field) to an existing collection in my process. This new column is located somewhere in the middle of the collection as it belongs to a a group of fields located there. However, after saving my work and opening it again, BP seems to be under the impression that newly added columns should be at the end of all columns and has moved it there. Whatever I do to keep it in position, BP moves it back again. Unfortunately, the collection definition panel does not come with 'Move up' and 'Move down' buttons as for instance the MultiCalc panel does.

Obviously, I could create a new collection with the same fields but now directly in the correct order, and throw away the 'faulty' one but this seems like the last resort workaround to me. 

My question:
How can I, when adding a new column to an existing collection, ensure it will stay where I defined it?

Note:
This collection is not derived from an Excel so editing an Excel to solve this issue is not an option.

------------------------------
Happy coding!
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)
1 BEST ANSWER

Best Answers

Hi Paul,

There may be a slightly easier solution here, especially if you know the exact columns and are only looking to add one or two columns.  

It's a three step process:

1. Split the collection
2. Add column(s) to the collection that contains the first set of columns
3. Merge the two collections that were originally split, back into one. 

I put together an example and attached it here. 


------------------------------
Nicholas Rudy
Senior Solution Engineer
Blue Prism
America/Chicago
------------------------------

View answer in original post

6 REPLIES 6

John__Carter
Staff
Staff
Hi Paul - it's default behaviour unfortunately but you can add your support to the enhancement requests others have made:

https://community.blueprism.com/ideas/ideas/viewidea?IdeationKey=1a2434d0-e7cf-4492-9880-96181d8704c5
https://community.blueprism.com/ideas/ideas/viewidea?IdeationKey=b4eee203-cdf2-4ad6-bcd0-4ca52e44e4e0

As a workaround, and I admit this is very ugly, copy the collection and paste into a text editor that can format XML, eg Notepad++. You'll quickly see how to manipulate the XML and then just copy/paste back into the diagram. If it doesn't paste back in, then you've made a mistake when changing the XML.

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

Hi John,

Thanks for the swift reply! And thanks for the links, I now support both!

I employed Excel's many features to get the collection as I want it to be. This implies my process now has to read the XL and copy the contents to a collection, something that could have been avoided. This is not the most beautiful solution either but was easier for me to implement than the XML solution provided by you.

------------------------------
Happy coding!
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

Hi Paul,

There may be a slightly easier solution here, especially if you know the exact columns and are only looking to add one or two columns.  

It's a three step process:

1. Split the collection
2. Add column(s) to the collection that contains the first set of columns
3. Merge the two collections that were originally split, back into one. 

I put together an example and attached it here. 


------------------------------
Nicholas Rudy
Senior Solution Engineer
Blue Prism
America/Chicago
------------------------------

Hi Nicholas,

Nice! I'll certainly try that tomorrow.

As can be deducted from my earlier response, the issue was resolved. Is there a 'Solved' button I can press?


------------------------------
Happy coding!
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

Hi Paul,

There is no "Solved" button that I can see, but I wanted to provide a solution within the bounds of the core product that is not reliant on XML manipulation. 🙂

------------------------------
Nicholas Rudy
Technical Innovation Manager
Blue Prism
Chicago
------------------------------

SamAssaf
Level 3

Hi Paul!

That's a great question! I solved this problem by creating an extension to the Collection Manipulation VBO and coding the functionality. In C# or VB, this can be done using the DataColumn.SetOrdinal(Int32) method.

I hope this helps! Please reach out if you require further information.

Cheers,



------------------------------
Sam Assaf
Senior
EY
Montreal QC
------------------------------