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

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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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

Highlighted
Regular Visitor

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.

Highlighted
Frequent Visitor

Re: Adding Gallery Data to a Collection

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

Highlighted
Kudo Kingpin
Kudo Kingpin

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,013)