cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Madumi
Level: Powered On

Help creating/updating a Collection

I'm having some basic trouble creating a collection & am anticipating troubles updating the collection. The collection is meant to draw from columns in an Entity "Member  Agency", and I need three columns, two of which are lookup fields: Name (Text), State (Lookup), and Organization (Lookup).

I am using the following formula, which exposes my first problem:

 

Collect(MemberAgencyCollection,'Member Agencies'.Name,'Member Agencies'.State.Name,'Member Agencies'.Organization.Name)

 

i.e. the lookup fields "State," and "Organization" use columns I want to collect with the same title: "Name." Is there a workaround I can use short of re-naming the Entity columns?

My second problem is that I intend to use this collection for finding records in a gallery while also allowing the user to edit them in a form. At present, I have the collection running at OnStart of the App. I should be able to move it to the OnSuccess of the editing form, but what is the most efficient way of updating the Collection? (ClearCollect, Patch, something else?)

thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Help creating/updating a Collection

Hi @Madumi ,

Could you please share a bit more about your scenario?

Do you want to collect a collection from your Entity records without renaming the column name?

 

For first question, I think the ForAll function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

Clear(MemberAgencyCollection);
ForAll(
       'Member Agencies',
       Collect(
               MemberAgencyCollection,
               {
                 Name: 'Member Agencies'[@Name],
                 State:  'Member Agencies'[@State],
                 Organization: 'Member Agencies'[@Organization]
               }
       )
)

or

Clear(MemberAgencyCollection);
ForAll(
       'Member Agencies',
       Collect(
               MemberAgencyCollection,
               {
                 Name: Name,
                 StateName:  State.Name,
                 Organization: Organization.Name
               }
       )
)

 

For your second question, if you want to update the collection in your app, you could consider type above formula within the OnSuccess property of the Edit form again, then when you made some changes to your 'Member Agencies' Entity records through the Edit form, re-collect your collection again.

 

Best regards,

Community Support Team _ Kris Dai
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

1 REPLY 1
Community Support Team
Community Support Team

Re: Help creating/updating a Collection

Hi @Madumi ,

Could you please share a bit more about your scenario?

Do you want to collect a collection from your Entity records without renaming the column name?

 

For first question, I think the ForAll function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

Clear(MemberAgencyCollection);
ForAll(
       'Member Agencies',
       Collect(
               MemberAgencyCollection,
               {
                 Name: 'Member Agencies'[@Name],
                 State:  'Member Agencies'[@State],
                 Organization: 'Member Agencies'[@Organization]
               }
       )
)

or

Clear(MemberAgencyCollection);
ForAll(
       'Member Agencies',
       Collect(
               MemberAgencyCollection,
               {
                 Name: Name,
                 StateName:  State.Name,
                 Organization: Organization.Name
               }
       )
)

 

For your second question, if you want to update the collection in your app, you could consider type above formula within the OnSuccess property of the Edit form again, then when you made some changes to your 'Member Agencies' Entity records through the Edit form, re-collect your collection again.

 

Best regards,

Community Support Team _ Kris Dai
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

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,963)