cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVTS
Super User
Super User

Filter value in Dual Collections

Experts,

 

I have got two collections . Collection1 : test9 and Collection 2 : test91. Now i would like to filter the both collections and display it in gallery.

 

At the moment i am able to view only one collections with following comment. Which is working fine. 

 

Filter(
test9 , syncType = "F" ,
Dropdown3.Selected.Value = ""
Or orderClass=Dropdown3.Selected.Value Or TextInput12.Text=equipmentCode Or TextInput12_1.Text=customerCode )

 

Requirement is that i want show two collection details in single gallery , 

 

tried with following comment which is not working . Please guide me with your expertise. 

 

Filter(
test9 , syncType = "F" & test91 ,syncType = "P" ,
Dropdown3.Selected.Value = ""
Or orderClass=Dropdown3.Selected.Value Or TextInput12.Text=equipmentCode Or TextInput12_1.Text=customerCode )

 

 

 

 

9 REPLIES 9
Drrickryp
Super User
Super User

@AVTS 

Is the structure of both collections the same?  If not, is there a common field between both collections?

WarrenBelz
Super User
Super User

Hi @AVTS ,

Just combine them - note I have made no attempt to look at your existing code structure

With(
   {
      w1:
      Filter(
         test9 , 
         syncType = "F" ,
         Dropdown3.Selected.Value = "" Or 
         orderClass=Dropdown3.Selected.Value Or 
         TextInput12.Text=equipmentCode Or 
         TextInput12_1.Text=customerCode 
      ),
      w2:
      Filter(
         test91, 
         syncType = "F" Or
         syncType = "P" ,
         Dropdown3.Selected.Value = "" Or 
         orderClass=Dropdown3.Selected.Value Or 
         TextInput12.Text=equipmentCode Or 
         TextInput12_1.Text=customerCode 
      )
   },
   ClearCollect(
      colAll,
      w1,
      w2
   )
)

 

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 i am getting following error ,

 

AVTS_0-1657604121437.png

 

 

Also is it bad idea to use like this , 

 

Filter(
         test9, 
         syncType = "F" & test91 ,
         syncType = "P" ,
         Dropdown3.Selected.Value = "" Or 
         orderClass=Dropdown3.Selected.Value Or 
         TextInput12.Text=equipmentCode Or 
         TextInput12_1.Text=customerCode 
      )

Yes both collections structure is same 

@AVTS ,

I was using your code (as I said, I did not look at your structure) assuming the collections had the same fields - it so, what I have posted will work. Is this not the case ?

Hi @WarrenBelz  structure is same . 

@AVTS ,

Then you can simply put them together with a combined collection. What is the collection code for Test91 ?

Although looking at is again, you may simply need to combine the filters

ClearCollect(
   colAll,
   Filter(
      test9,
      (syncType = "F" || syncType = "P") &&
      (
         Len(Dropdown3.Selected.Value = 0) || 
         orderClass=Dropdown3.Selected.Value
      ) &&
      (
         equipmentCode =TextInput12.Text || 
         customerCode = TextInput12_1.Text
      )
   )
)

 

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 ,

i have two collections test9 and test91 ,

 

below is test 9 which is working fine. 

Filter(
test9 , syncType = "F" ,
Dropdown3.Selected.Value = ""
Or orderClass=Dropdown3.Selected.Value Or TextInput12.Text=equipmentCode Or TextInput12_1.Text=customerCode )

 

Requirement is i wanted to filter one more collections(test91) with Synctype = "P" and so that gallery will display and filter from both collections. structure is same in both collections. 

 

@AVTS ,

If you already have the collections, then you can do this providing the structure is the same

ClearCollect(
   colAll,
   test9,
   test91
)

although that I posted for the combined result will also work (it is including both sync types in the Filter)

 

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

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,483)