cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrendonBrooksP1
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

12 REPLIES 12
sajarac
Kudo Kingpin
Kudo Kingpin

Hi @JanaH , this is what I have:

I am collecting different values from 2 galleries plus some individual values (var) using this:

 

ClearCollect(
QuoteHeader,
{
Customer: varCustomerName,
Region: varCustomerState,
Quote: varSAPNumber,
Freight: Value(NQTextInputFreight.Text),
Contact: varContactName,
Created: Today()
}
);
ClearCollect(
QuoteGallery1,
ForAll(
GalleryDatabase.AllItems,
{
Name: GDBuildingName.Text,
Item: GDBidItem.Text,
Title: GDLblDescription.Text,
UoM: GDUoM.Text,
Price: GDTextInputPrice.Text,
Quantity: Value(GDTextInputQty.Text)
}
)
);
ClearCollect(
QuoteGallery2,
ForAll(
GalleryDatabase2.AllItems,
{
Name2: GDBuildingName_1.Text,
Item2: GDBidItem_1.Text,
Title2: GDLblDescription_1.Text,
UoM2: GDUoM_2.Text,
Price2: GDTextInputPrice_2.Text,
Quantity2: Value(GDTextInputQty_2.Text)
}
)
);
ClearCollect(
Submission,
{
Header: QuoteHeader,
AEPAQuote1: QuoteGallery1,
AEPAQuote2: QuoteGallery2
}
);

 

For individual values I am colleting "Quote Header"

Two galleries I am collecting QuoteGalley1 and QuoteGallery2

And for the final submission I am collecting "Submission" that is the value that I am passing to my flow as a JSON.

 

I hope this helps.

 

Regards.

JanaH
Frequent Visitor

Thx for your help and patience! 😁

 

Your solution is exactly what I want:

JanaH_1-1615744076981.png

ClearCollect(Collection2; ForAll(Gallery1.AllItems;
{
    Spalte1: Besteller.Value;
    Spalte2: Kostenstelle.Value;
    Spalte3: Verwendung
}
))

PowerAutomate runs fine, too!

But unfortunalety my CSV file is empty now... 😒

sajarac
Kudo Kingpin
Kudo Kingpin


Parse the JSON Schema, then map the values

 

 

sajarac_0-1615744548185.png

 

 

sajarac_1-1615744594913.png

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,848)