cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

Collections in powerapps

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 

1 ACCEPTED SOLUTION

Accepted Solutions

@Tejasvi_munge 

 

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 SolutionMarking 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.

 

View solution in original post

6 REPLIES 6
Dual Super User
Dual Super User

@Tejasvi_munge 

 

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 SolutionMarking 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. 

@Tejasvi_munge 

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. 

@Tejasvi_munge 

 

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 SolutionMarking 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

   

@Tejasvi_munge 

 

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 SolutionMarking 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.

 

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (13,226)