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

auto-filter results of gallery which is based on another gallery

Hi,

 

I have two galleries:  Accounts gallery and Opportunities gallery. 

 

I want the opportunities gallery to show: 1) opportunities related only to the account selected in the accounts gallery, and 2) of those opportunities, only those which have an opportunity type = New Client and a status of Open.

 

Right now the items property of the opportunity gallery is: 

'Gallery Accounts'.Selected.'Opportunities (opportunity_parent_account)'

 

This formula works to get every opportunity related to the selected account, but I don't know how to incorporate the other criteria for opportunity type and status.

 

Thank you in advance for help!

8 REPLIES 8
WarrenBelz
Super User
Super User

Hi @SRW04027 ,

The structure should be something like this

Filter(
   YourOpportunitiesList,
   YourParentAccountField = 'Gallery Accounts'.Selected.'Opportunities (opportunity_parent_account)' &&
   YourOpportunityTypeField = "New Client" &&
   YourStatusField = "Open"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi @WarrenBelz ,

 

Thank you for your response.  I've updated my opportunities gallery items property to:

 

Filter(
Opportunities,
'Account/Household'='Gallery Accounts'.Selected.'Opportunities (opportunity_parent_account)'
&&
Type="New Client"
&&
Status=0
)

 

This doesn't produce an error but does produce a warning about delegation.  I don't understand why, since I'm specifying the exact account record to be returned by using the gallery accounts selected account.

Hi @SRW04027 ,

I assume that the fields 'Account/Household' and Type are Single Line of Text. What type of field is Status?

WarrenBelz
Super User
Super User

Hi @SRW04027 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi @WarrenBelz ,

 

Happy New Year!

 

'Account/Household' is a lookup field on the opportunity to the related account record.  Type and Status are both option sets.

@SRW04027 ,

That is your issue - this document may assist.

@WarrenBelz ,

 

Thank you, but that didn't work. I'm getting an error that the names are not valid. 

 

Filter(
Opportunities,
'Account/Household'='Gallery Accounts'.Selected.'Opportunities (tam_account_opportunity_AccountHousehold)'
&&
Type=[@Type.New Client]
&&
Status=[@Status.Open]
)

 

I think that is because the documentation you referenced assumes the option set is in the app.  The option sets for opportunity Type and opportunity Status reside on the opportunity entity in my data source.

@SRW04027 ,

I sent the document link as I am not a Dataverse user, although the document refers to Option Sets in the Entity (they cannot "reside" in the app, which has not data of its own). Can you please ensure you state your data source on any posts as this will affect both the response and often who is able to do so. This guide may also be of assistance to you. I will move your post to the Dataverse forum and I am sure someone will answer you these.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (3,843)