cancel
Showing results for 
Search instead for 
Did you mean: 

Rearrange collection data

GuggsKia
Level 4
Hello Team,
I have a collection like below:
Column0 Column1
A.              12
B.               10
A.               xyz
BB.             20
AD.             32

Now, I want to kind of transpose this collection but since the Column0 can have same values I am not able to use any smart way to do it using Append field due to this.

Currently, I am trying to build a solution that has one single row collection with predefined fields and I want to write the Column1 values on by one to the single row of this collection. I mean my collection should look something like below:

ID QR Code Type OFC
12 10 xyz    20    32

Any suggestions?


------------------------------
Guggs Kia
------------------------------
1 BEST ANSWER

Helpful Answers

hi Guggs, 

Column names should be unique as per BP. Not sure, if you can make it unique by adding some special char followed by Unique number/counter - column counter

A_1     B_2      A_3
10        12       xyz


------------------------------
Manish Kumar
------------------------------

View answer in original post

7 REPLIES 7

mkumar407
Level 7
hi Guggs,

There is already Transpose Collection Action available in Collection Manipulation. You can use it? 

13405.png
Apologies if I didn't understood your query correctly.

------------------------------
Manish Kumar
------------------------------

Hi Manish,
I was trying this action but it doesn't give mei the desired output. Please find attached image.
13406.jpg


------------------------------
Guggs Kia
------------------------------

hi Guggs,

Please try this:
1. Create New Empty Collection for Transpose Collection
2. After Start - Add Row to Transpose Collection
3. Loop your Initial collection
4. Use Collection Manipulation - Append Field (Text) with input parameter as  Collection as Transpose Collection, Field Name - Initial_Collection.Column0 and Field Value - Initial_Collection.Column1
5. output parameter as Transpose Collection
Once loop is over, you will have your transposed collection.

Hope this will help.





------------------------------
Manish Kumar
------------------------------

Thanks a lot for this solution, Manish. 
This is perfect solution but as I have mentioned in Problem statement, my Column 0 values are not unique. So it is overwriting for many rows.
any way to avoid this?

------------------------------
Guggs Kia
------------------------------

hi Guggs, 

Column names should be unique as per BP. Not sure, if you can make it unique by adding some special char followed by Unique number/counter - column counter

A_1     B_2      A_3
10        12       xyz


------------------------------
Manish Kumar
------------------------------

Works for me using this counter thing.
Perfectly working!!

Thanks a lot, Manish!

------------------------------
Guggs Kia
------------------------------

Glad that it works for you. I am happy to help.

------------------------------
Manish Kumar
------------------------------