Hello all,
In a collection called mergedData contains different columns.
I have a column named Tag that allow a row to contains multiple values (Choices from Sharepoint) such as this one:
I also have a column named UserTag that contains multiple values but as a string:
I would like to add a column to the collection that has the same data type as Tag but for UserTags. Is it possible?
Thanks in advance.
Thanks,
Kin
Solved! Go to Solution.
@kccchiu ,
This should work
ClearCollect(
colMyCollection,
AddColumns(
mergedData,
"MyNewColumn,
Split(
UserTag,
","
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
As I'm only on my mobile I can't verify the Syntax but try something like
Set(mergedDataV2, AddColumn(mergedData, tagRecordColumn, Split(UserTag, ",")))
Thanks for the reply, but I have built quite a lot of things around the mergedData collection and would like to have the new column in the mergedData collection.
I have tried your formula but had some error.
Thanks,
Kin
Hello Thanks for the reply.
The UserTag field is just a string and it follows a pattern like:
string1, string2, stringn
The UserTag column is from a sharepoint list, and the type of column is single line of text.
I had to work with different sharepoint list so I had to merged 2 lists into a collection.
Thanks,
Kin
Okay, so you should first split the UserTag with the Split(UserTag,",") function. Then you will have a collection of strings.
But wait... so you have two different lists. So dont merge the UserTag directly with the tags. First split them and then merge them with the tags!
Once your mergedData Collection got created you can't add any new columns. Thats simply not possible.
I have tried this:
ClearCollect(mergedData,mySharePointList);
ClearCollect(mergedDatav2,AddColumns(mergedData,"UserTagAsRecord",Split(ThisRecord.'UserTag',"-")));
mergedDatav2 is identical to mergedData but has the addition UserTagAsRecordColumn
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Thanks for the reply.
I tried your formula and got this result:
Is it possible to achieve this?
<-- I used paint to illustrate the result I want.
Thanks,
Kin
The only difference is that using my formula the field UserTagRecords is a Table and you want it to be Records.
I actualy can't see any benefits.
You might be confused because it still shows as comma separated values but this is not th case.
Add a Gallery and use mergedDatav2 as the datasource. Add a second Gallery and use Gallery1.Selected.UserTagRecords in the Items Property. You will see you get each item displayed in a separate row.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
User | Count |
---|---|
251 | |
250 | |
82 | |
45 | |
28 |
User | Count |
---|---|
348 | |
262 | |
127 | |
60 | |
58 |