Hi All,
I am trying to copy one collection from another. How can I achieve that?
I have tried collect but it it not working.
On one single button click I want to collect data in one collection(suppose Col1). And I want to copy it on same button click(second collection - Col2). Actually I am creating a one record having guid as column using GUID()function in Col1 and same I want to pass or copy in Col2.
Any help will be appreciated
Solved! Go to Solution.
On Submit, you can do this:
ClearCollect(Col1, {Guid: txtGUID.Text, Name: txtName.Text}); ClearCollect(Col2, Col1)
You can have both ClearCollect statements with semi colon as separator.
Both collections will have same record.
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |
Its simple.
ClearCollect(Col2, Col1)
The above statement copies the col1 into col2.
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |
Hi @rsaikrishna ,
I have tried that but it is satisfying my scenario.
Suppose I create a record and collect in Col1 and copied in Col2 then I am clearing Col1. Now , So Col2 is using as storage of records and Col1 will have only one record.
The quickest way to get the desired result is to provide sample data and then show the desired result. If you do this I believe it will be much easier for @rsaikrishna to give the solution you want.
Thanks you @mdevaney
@mdevaney created collections cookbook. See if this helps you.
https://matthewdevaney.com/powerapps-collections-cookbook/
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |
Hi @mdevaney and @rsaikrishna ,
I have one screen and based on user input I am collecting it one collection called Col1 on "Submit " button click.
And Col1 will look like-
Guid Name
d29c01ea-33fe-ea11-a813-000d3ab1893a Raj
It contains Only one record at a time.
Now on same "submit " button click I want to create a Col2 where I can append the record from Col1 before clearing Col1
On Submit, you can do this:
ClearCollect(Col1, {Guid: txtGUID.Text, Name: txtName.Text}); ClearCollect(Col2, Col1)
You can have both ClearCollect statements with semi colon as separator.
Both collections will have same record.
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |
User | Count |
---|---|
221 | |
99 | |
94 | |
55 | |
36 |
User | Count |
---|---|
273 | |
104 | |
104 | |
60 | |
60 |