Breaking News

How to stop "Filter Collection" from sorting the result by default ?

Q:


I have a collection with one column data as below: (Collection In = Lines)
|------------------------------------------|
Field Name = Line (Text)
Name                Microsoft OneDrive for Business
Publisher           Microsoft Corporation
Status              New
Name                McAfee Endpoint Security Web Control
Publisher           McAfee, Inc.
Status              Enabled
Name                Send to OneNote
Publisher           Not Available
Status              Disabled
|------------------------------------------|
Now I want to convert this to a (Name|Status) collection, so I first filter the collection by Name & then by Status & then merge the 2 collections to obtain something like below: (This works fine except the entries misalign as they get sorted alphabetically by default within "Filter Collection" stage which is not desired)
|-----------------------------------|-------|
Name (Text) | Status Text)
Microsoft OneDrive for Business  | New
McAfee Endpoint Security Web Control | Enabled
Send to OneNote | Disabled
|-----------------------------------|-------|
The Collection manipulation -> Filter Collection stage is giving in snapshot has Collection In as "Lines" above & the Filter is given as "[Line] LIKE '%Name%'"
The inbuilt VBO "Filter collection" is by default given the filtered output in a new Collection in a sorted order like below
|------------------------------------------|
Line (Text)
McAfee Endpoint Security Web Control
Microsoft OneDrive for Business 
Send to OneNote
|------------------------------------------|
but I need it in the order of Collection In as it is... Unsorted. How do I do it?
Why is the "Collection Manipulation" -> "Filter Collection"  VBO Sorting the filtered result alphabetically by default when there is already another action of "Sort Collection" already present in same VBO?
Please tell me how to change the default behavior of this VBO to not sort the Output Collection. What changes I can do or which is easiest way to fix this.
 A:
you can try by creating custom transpose for collection. 
1. Get Original Data into first collection.
2. Identify manually unique rows.. like 3 in above case and row position which is required as in column in another collection (eg. 1 & 3 above)
3. Create new second collection and Loop original collection with counter of rows
4. Use Choice  and Set new collection values as per loop and increase counter value.
5. Reset counter once it reaches max
6. add new row to second collection and it will follow step 4.
7. Remove empty rows (may be last row will be empty)
second collection will have data as per your need.
Done!
A:
C# code to append an AI/PK column to the collection. I'm pretty sure the PK flag will go away on export, but you can use it internally if you need to. It's a bit hacky, but it'll do the job.
In: "Collection" - Collection
Out: "New_Collection" - Collection
 
DataColumn col = new DataColumn();
col.DataType = System.Type.GetType(""System.Int32"");
col.ColumnName = ""AIid"";
col.AutoIncrement = true;
col.AutoIncrementSeed=0;
col.AutoIncrementStep = 1;
Collection.Columns.Add(col);    
int index = 0;
foreach(DataRow row in Collection.Rows)
{
        row[""AIid""]=index++;
}
New_Collection = Collection;

1 comment:

  1. How To Stop "Filter Collection" From Sorting The Result By Default ? - Blue Prism For You >>>>> Download Now

    >>>>> Download Full

    How To Stop "Filter Collection" From Sorting The Result By Default ? - Blue Prism For You >>>>> Download LINK

    >>>>> Download Now

    How To Stop "Filter Collection" From Sorting The Result By Default ? - Blue Prism For You >>>>> Download Full

    >>>>> Download LINK rx

    ReplyDelete