cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Medoomi
Helper V
Helper V

gallery, dependent on another gallery, refuses to select first item

I have a primary gallery, 'galMemberAgencies' which, when an item is selected, filters a second gallery, "galMemberAgencyContactLists" like so:

 

Items: Filter('Member Agency Contact Lists',cr6a2_Agency.Autonumber = galMemberAgencies.Selected.Autonumber)

 

My problem is that 50% of the time, when I select an item in the primary gallery, the second gallery filters correctly, but fails to pre-select the first item on the gallery. As such, its associated form fails to load with an error message: "No Item to Display."

 

How can I ensure the first item in the second gallery always gets selected?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Medoomi ,

Actually, the first item in the gallery will be the gallery's default selected item. It does need any trigger.

No matter whether you select item in gallery, gallery.selected should not be blank value.

I agree with @GarethPrisk . This issue should be about delegation. When there's no record in gallery2, gallery.selected may be blank.

Could you tell me:
1)what is your data source?

2)data type of Autonumber field?
3)how many records in 'Member Agency Contact Lists' and galMemberAgencies list?

 

If their record is smaller than 2000, you just need to change delegation limit to 2000.

delegation.jpg

 

If data source data is larger than 2000, you have two soltions:

1)change filter rule.

Your data source looks like sharepoint list. In shearepoint list, only ID field is delegate by using "=".

2)save your two lists to collection.

In collection, there's no delegation limit.

Use the two collections as your data source to filter and display data in gallery, display form, edit form.

 

Here's a doc about delegate functions of sharepoint list for your reference:
https://docs.microsoft.com/en-us/connectors/sharepointonline/

 

 

Best regards,

Community Support Team _ Phoebe Liu
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
GarethPrisk
Resident Rockstar
Resident Rockstar

Hello again @Medoomi 😀

 

As you can guess, I recommend that you use a variable for this. Not only will you explicitly know what the filtering value is, but most times a Filter will require a variable reference to avoid delegation during the retrieval of data.

 

Like in the other post, before you navigate to the second screen/gallery, set a variable equal to the selected item from gallery 1. Hope this helps!

Thx so much @GarethPrisk , I really appreciate the input.

The only difficulty in this case is that both galleries are on a single screen, so there is no trigger which will select the first item in the second gallery--does that make sense?

And by using a variable, do you mean replacing "galMemberAgencies.Selected.Autonumber" with the previously set variable?

Hi @Medoomi ,

Actually, the first item in the gallery will be the gallery's default selected item. It does need any trigger.

No matter whether you select item in gallery, gallery.selected should not be blank value.

I agree with @GarethPrisk . This issue should be about delegation. When there's no record in gallery2, gallery.selected may be blank.

Could you tell me:
1)what is your data source?

2)data type of Autonumber field?
3)how many records in 'Member Agency Contact Lists' and galMemberAgencies list?

 

If their record is smaller than 2000, you just need to change delegation limit to 2000.

delegation.jpg

 

If data source data is larger than 2000, you have two soltions:

1)change filter rule.

Your data source looks like sharepoint list. In shearepoint list, only ID field is delegate by using "=".

2)save your two lists to collection.

In collection, there's no delegation limit.

Use the two collections as your data source to filter and display data in gallery, display form, edit form.

 

Here's a doc about delegate functions of sharepoint list for your reference:
https://docs.microsoft.com/en-us/connectors/sharepointonline/

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks so much @v-yutliu-msft 

I really appreciate the reply.

After reading your comment that gallery.selected should not be blank, I went through and tested the gallery & found some rogue code in some fields. Since correcting that, the second gallery is loading properly as far as I can tell. I'll report back if the problem re-surfaces,

thx!

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

Top Solution Authors
Users online (1,985)