cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gbrown
Frequent Visitor

Patching into a Customer Field From a Collection

Hi,

 

Working on a canvas app to create intersect records between the standard 'Accounts' entity and a custom 'Events' entity.  The intersect is called 'Event Participation'.  It is a manual N:N.  The record has a look-up field called "Event Participation ID", which is the ID of the Events record.  It also has an 'Attendee' field which is defined as a customer data type.  Originally we were accepting Account or Contact attendee information, but now it's all Accounts.  I have created a gallery that is populated by a collection of all Accounts.  This helps me avoid delegation issues and also to reshape the data by adding an 'IsChosen' field.  In the gallery, users can push a button on each row to send that row to the 'Events Participation' intersect and it works well.  The issue happens when they select multiple rows via the "IsChosen" check-box and I use that to do a 'ForAll' patch to the 'Events Participation.  Below are some screen shots of the app, and also the button's on-select code for the 'ForAll' patch.  Not sure what I'm doing wrong.  It will create a record in Events Participation for each selected row in the gallery, but doesn't set the Attendee.

 

Button's code:

ForAll(
Filter(
colAccountDat,
IsChosen
),
Patch(
[@'Events Participation'],
Defaults([@'Events Participation']),
{'Event Participation ID': [@ModelDrivenFormIntegration].Item},
{
Attendee: {
ID: colAccountDat.accountid,
Value: colAccountDat.name
}
}
)
)

 

Any help anyone could provide would be greatly appreciated.

 

EmbeddedCanvasApp.pngButtonForAllPatch.png

1 ACCEPTED SOLUTION

Accepted Solutions
gbrown
Frequent Visitor

I've solved this issue with some help from Shane Young and PowerApps911.  To achieve the patch, I take advantage of the new "As" functionality:

 

ForAll(Filter(AccountGallery.AllItems, gCheck.Value = true) As InRec,
Patch(
[@'Events Participation'],
Defaults([@'Events Participation']),
{
Attendee: InRec,
'Event Participation ID': [@ModelDrivenFormIntegration].Item
}
));

View solution in original post

2 REPLIES 2
gbrown
Frequent Visitor

I've solved this issue with some help from Shane Young and PowerApps911.  To achieve the patch, I take advantage of the new "As" functionality:

 

ForAll(Filter(AccountGallery.AllItems, gCheck.Value = true) As InRec,
Patch(
[@'Events Participation'],
Defaults([@'Events Participation']),
{
Attendee: InRec,
'Event Participation ID': [@ModelDrivenFormIntegration].Item
}
));

Many online software and applications are available which providing the best-written tips for collecting the customer fund. Most of the people get one of the best-written options on the britishessays.net site page which offers useful tips for students who want to get the best writing samples to complete any kind of writing work.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Users online (2,309)