cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Adding Gallery Data to a Collection

Good day to you all. My goal for this part of my application is for a user to file a report that lists all items that are either in the Safe or a Work Bag. The report is then generated, and then sent via email to a distribution group. The report has the following criteria:

 

1. A list of all items, by serial number and item type. 

2. Total amount of items in both locations.

3. Date and time of the report. 

 

 

So far, I've been able to filter this data, via three seperate dropdowns,  in a gallery or a datatable with no issues.  However, now I need to take the data from the gallery and then send it in an email. Emailing in PowerApps has been covered in a few threads already. I know that the best way to do this is have the data put into a Collection and then email it. 

 

How can I pull specific parts of data (namely text) and then store them into a collection? Is that possible?

 

 

v/r

Brendon

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Adding Gallery Data to a Collection

Hi @BrendonBrooksP1,

 

If the Gallery data is what you would like to save in a collection, then you could take use of clearcollect () function to save it into a collection, for example:

Clearcollect(CollectionNeeded, Gallery1.AllItems)

Besides, if you only want to keep special column, then we could dropdown the other columns with the Dropcolumns function:

"

DropColumns( Table, ColumnName1 [, ColumnName2, ... ] )

  • Table - Required. Table to operate on.
  • ColumnName(s) - Required. Name(s) of the column(s) to drop. You must specify a string (for example, "Name" with double quotes included) for this argument.

"

Function reference:

AddColumns, DropColumns, RenameColumns, and ShowColumns function in PowerApps

Collect, Clear, and ClearCollect functions in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Adding Gallery Data to a Collection

Hi @BrendonBrooksP1,

 

If the Gallery data is what you would like to save in a collection, then you could take use of clearcollect () function to save it into a collection, for example:

Clearcollect(CollectionNeeded, Gallery1.AllItems)

Besides, if you only want to keep special column, then we could dropdown the other columns with the Dropcolumns function:

"

DropColumns( Table, ColumnName1 [, ColumnName2, ... ] )

  • Table - Required. Table to operate on.
  • ColumnName(s) - Required. Name(s) of the column(s) to drop. You must specify a string (for example, "Name" with double quotes included) for this argument.

"

Function reference:

AddColumns, DropColumns, RenameColumns, and ShowColumns function in PowerApps

Collect, Clear, and ClearCollect functions in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

jwademcg
Level: Powered On

Re: Adding Gallery Data to a Collection

If you want only specific columns, just figured that out.  You nest the ShowColumns function within the ClearCollect

 

Clearcollect(CollectionNeeded, ShowColumns(Gallery1.AllItems,"ColumnName1","ColumnName2","ColumnName3","etc..."))

 

The column names must be in quotes.

wayneb
Level: Powered On

Re: Adding Gallery Data to a Collection

This helped me so much! I was over complicating what I was trying to do!

sajarac
Level 8

Re: Adding Gallery Data to a Collection

@jwademcg , Hi there, quick question for this specific point:

 

Clearcollect(CollectionNeeded, ShowColumns(Gallery1.AllItems,"ColumnName1","ColumnName2","ColumnName3","etc..."))

If I have values in my collection plus values form different list how Can I include those values in the newly created collection?

 

The reason why I am asking you is because if I include those labels into my collection then my flow fails.

 

Capture.PNG

 

Thank you very much.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,301)