web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Search from two differ...
Power Apps
Unanswered

Search from two different lists in gallery

(0) ShareShare
ReportReport
Posted on by 53

Hi, 

 

Trying to search (the searchbox headerProject_1.SearchValue) items from two different lists, however getting the delegation warning and search isn't working. as you can see in the image below.

 

This peace of code is creating the problem, any better way to do it ? headerProject_1.SearchValue is the searchbox.

headerProject_1.SearchValue in Filter('DC-SS-Setup-Project',RequestID=RequestID).'NetSuite SOW ID')),


Delegation warning.

amanverma_0-1662619529867.png

 

Here is the complete code. 

 

SortByColumns(
 Filter([@'DC-SS-Requests'],
 Or(IsBlank(cboStatusFilter_Admin_1.Selected.Value),IsEmpty(cboStatusFilter_Admin_1.SelectedItems),Status=Index(cboStatusFilter_Admin_1.SelectedItems,1).Value,Status=Index(cboStatusFilter_Admin_1.SelectedItems,2).Value,Status=Index(cboStatusFilter_Admin_1.SelectedItems,3).Value),
 
 Or(IsBlank(cboRequestorFilter_Admin_1.Selected.Email),IsEmpty(cboRequestorFilter_Admin_1.SelectedItems),StartsWith(Requestor.Email,cboRequestorFilter_Admin_1.Selected.Email)),Or(IsBlank(cboAssignedToFilter_Admin_1.Selected.Email),IsEmpty(cboAssignedToFilter_Admin_1.SelectedItems),StartsWith(AssignedTo.Email,cboAssignedToFilter_Admin_1.Selected.Email)),
 
 Or(IsBlank(cboRegionFilter_Admin_1.Selected.Result),IsEmpty(cboRegionFilter_Admin_1.SelectedItems),Region=Index(cboRegionFilter_Admin_1.SelectedItems,1).Result,Region=Index(cboRegionFilter_Admin_1.SelectedItems,2).Result,Region=Index(cboRegionFilter_Admin_1.SelectedItems,3).Result),
 
 Or(IsBlank(cboTypeFilter_Admin_1.Selected.Result),IsEmpty(cboTypeFilter_Admin_1.SelectedItems),RequestType=Index(cboTypeFilter_Admin_1.SelectedItems,1).Result,RequestType=Index(cboTypeFilter_Admin_1.SelectedItems,2).Result,RequestType=Index(cboTypeFilter_Admin_1.SelectedItems,3).Result),
 
 Or(IsBlank(cboCustomerFilter_Admin.Selected.Result),IsEmpty(cboCustomerFilter_Admin.SelectedItems),Customer=Index(cboCustomerFilter_Admin.SelectedItems,1).Result,Customer=Index(cboCustomerFilter_Admin.SelectedItems,2).Result,Customer=Index(cboCustomerFilter_Admin.SelectedItems,3).Result,Customer=Index(cboCustomerFilter_Admin.SelectedItems,4).Result,Customer=Index(cboCustomerFilter_Admin.SelectedItems,5).Result),
 
 Or(
 StartsWith(Customer,headerProject_1.SearchValue),
 StartsWith(AssignedTo.DisplayName,headerProject_1.SearchValue),
 StartsWith(Requestor.DisplayName,headerProject_1.SearchValue),
 StartsWith(RequestID,headerProject_1.SearchValue),
 StartsWith(Status,headerProject_1.SearchValue),
 StartsWith(Region,headerProject_1.SearchValue),
 headerProject_1.SearchValue in Filter('DC-SS-Setup-Project',RequestID=RequestID).'NetSuite SOW ID')),
 conSortColumn,
 If(!con_SortID,
 Descending,
 Ascending
 )
)

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,463 Most Valuable Professional on at

    Hi @amanverma , 

    I cannot see your data or required logic and this is free-typed (so watch commas/brackets etc), but this will be the best you can do managing Delegation. The output of the top filter (in the With() statement) needs to be under your Delegation limit

    With(
     {
     wList:
     Filter(
     [@'DC-SS-Requests'],
     Or(
     Len(cboStatusFilter_Admin_1.Selected.Value) = 0,
     Status = Index(cboStatusFilter_Admin_1.SelectedItems,1).Value,
     Status = Index(cboStatusFilter_Admin_1.SelectedItems,2).Value,
     Status = Index(cboStatusFilter_Admin_1.SelectedItems,3).Value
     ),
     Or(
     Len(cboRequestorFilter_Admin_1.Selected.Email) = 0,
     StartsWith(
     Requestor.Email,
     cboRequestorFilter_Admin_1.Selected.Email
     )
     ),
     Or(
     Len(cboAssignedToFilter_Admin_1.Selected.Email) = 0,
     StartsWith(
     AssignedTo.Email,
     cboAssignedToFilter_Admin_1.Selected.Email
     )
     ), 
     Or( 
     Len(cboRegionFilter_Admin_1.Selected.Result) = 0, 
     Region = Index(cboRegionFilter_Admin_1.SelectedItems,1).Result,
     Region = Index(cboRegionFilter_Admin_1.SelectedItems,2).Result,
     Region = Index(cboRegionFilter_Admin_1.SelectedItems,3).Result
     ), 
     Or(
     Len(cboTypeFilter_Admin_1.Selected.Result) = 0,
     RequestType = Index(cboTypeFilter_Admin_1.SelectedItems,1).Result,
     RequestType = Index(cboTypeFilter_Admin_1.SelectedItems,2).Result,
     RequestType = Index(cboTypeFilter_Admin_1.SelectedItems,3).Result
     ), 
     Or(
     Len(cboCustomerFilter_Admin.Selected.Result) = 0,
     Customer = Index(cboCustomerFilter_Admin.SelectedItems,1).Result,
     Customer = Index(cboCustomerFilter_Admin.SelectedItems,2).Result,
     Customer = Index(cboCustomerFilter_Admin.SelectedItems,3).Result,
     Customer = Index(cboCustomerFilter_Admin.SelectedItems,4).Result,
     Customer = Index(cboCustomerFilter_Admin.SelectedItems,5).Result
     ),
     Or(
     StartsWith(
     Customer,
     headerProject_1.SearchValue
     ),
     StartsWith(
     AssignedTo.DisplayName,
     headerProject_1.SearchValue
     ),
     StartsWith(
     Requestor.DisplayName,
     headerProject_1.SearchValue
     ),
     StartsWith(
     RequestID,
     headerProject_1.SearchValue
     ),
     StartsWith(
     Status,
     headerProject_1.SearchValue
     ),
     StartsWith(
     Region,
     headerProject_1.SearchValue
     )
     )
     )
     },
     SortByColumns(
     Filter(
     wList,
     headerProject_1.SearchValue in
     Filter(
     'DC-SS-Setup-Project' As aSetup,
     aSetup.RequestID = RequestID
     ).'NetSuite SOW ID'
     ),
     conSortColumn,
     If(
     !con_SortID,
     Descending,
     Ascending
     )
     )
    )

     

    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

     

  • amanverma Profile Picture
    53 on at

    thanks @WarrenBelz - Doesn't seem to work, no data returned in the gallery.. 

    We are showing data from 2 different lists in 1 gallery, so lists 1 has been set as datasource in the Items and list 2 data directly pulled in the gallery's field using lookup something like LookUp('DC-SS-Setup-Project',RequestID = ThisItem.RequestID).'NetSuite SOW ID'.

     

    I have a search box on the screen which users can use to search data from different columns except 'NetSuite SOW ID' as it comes from different list and not set to Items property. 
    So trying to make 'NetSuite SOW ID' searchable as well. Hope that gives you some detail!!

     

     

  • WarrenBelz Profile Picture
    155,463 Most Valuable Professional on at

    @amanverma ,

    I cannot see your data or model - what I posted was syntax guidance rather than code to be copied. You need to break this down into segments and test each one to see what is not working.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 638

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard