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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (74,336)