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

Filter two Galleries

I need help on this, i have a gallery A which has two date pickers datestart and dateend, this will filter the gallery based on date. The column name in sharepoint list is date and its a date formatted column. Gallery item is thisitem.date . 

Once this is done, gallery b will be selected based on the selection on gallery any item row. Now we have two dropdownboxes that is suppose to filter gallery b by partno and orderno. Under gallery A i set items as Filter(ConsumableRecord, ThisItem.Date >= Datestart && ThisItem.Date <= Dateend) but it's not able to load the gallery. please help

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @nchandran ,

Going back to your first post I see that now. You will need something like

Filter(
   ConsumableWithdraw,
   MasterID=GalleryCRWelderInfo.Selected.ID &&
   (
      IsBlank(YourddPartNo.Selected.xxxx) || 
      partno=YourddPartNo.Selected.xxxx
   ) &&
   (
      IsBlank(YourddOrderNo.Selected.xxxx) || 
      orderno=YourddOrderNo.Selected.xxxx
   )
)

The xxxx will be the valid output of the drop-down - I have also assumed some field names here.

 

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.

View solution in original post

10 REPLIES 10
Super User III
Super User III

@nchandran ,

Two things, Date is not a good title for a field as it is a Reserved Word in Power Apps and a filter for the second gallery would be

Filter(
   ConsumableRecord, 
   DateStart >= GalleryA.Selected.Date && DateEnd <= GalleryA.Selected.Date
) 

 

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.

warren i forgot to mention the 2nd gallery b has some referencing with the 1st gallery a. this is the code on item property for galleryb, i'm not sure how to place the logic. Data source Consumablerecord has a ID lookup field in Consumablewithdraw. Consumablerecord holds the staff information while the consumablewithdraw contains the items to withdraw.

 

 

 

Filter(ConsumableWithdraw,MasterID=GalleryCRWelderInfo.Selected.ID)

 

 

 

@nchandran ,

Can you please provide (in Text) the Items of both galleries. Also what do you mean by an ID lookup field and can you please confirm your data source type.

Sorry Warren. Datasource for gallery A is ConsumableRecord, source for gallery B is ConsumableWithdraw.

I had to endup using only one datepicker for the gallery A. 

Gallery A - Filter(ConsumableRecord,Text(Date,ShortDate) = Text(Datestart.SelectedDate,ShortDate))

Gallery B - Filter(ConsumableWithdraw,MasterID=GalleryCRWelderInfo.Selected.ID)

Hi @nchandran ,

I need to understand a bit more information here - your first gallery (I assume GalleryCRWelderInfo)

Filter(
   ConsumableRecord,
   Text(Date,ShortDate) = Text(Datestart.SelectedDate,ShortDate)
)

will select all the records where the field Date is equal to the date selected in your Datestart Date Picker control.

Your second gallery

Filter(
   ConsumableWithdraw,
   MasterID=GalleryCRWelderInfo.Selected.ID
)

will then get all the records from ConsumableWithdraw where the MasterID field equals the ID in  the record selected in GalleryCRWelderInfo.ConsumableRecord 

What is not working here (do you get ant errors and/or are the assumptions above correct)?

 

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.

Warren,

the second gallery needs to be filtered against the two dropdown boxes that is suppose to filter second gallery by Partno and Orderno these are the exact names in the sharepoint column. The two dropdowns are not working. the items for the two dropdowns is ConsumableWithdraw.

Hi @nchandran ,

Going back to your first post I see that now. You will need something like

Filter(
   ConsumableWithdraw,
   MasterID=GalleryCRWelderInfo.Selected.ID &&
   (
      IsBlank(YourddPartNo.Selected.xxxx) || 
      partno=YourddPartNo.Selected.xxxx
   ) &&
   (
      IsBlank(YourddOrderNo.Selected.xxxx) || 
      orderno=YourddOrderNo.Selected.xxxx
   )
)

The xxxx will be the valid output of the drop-down - I have also assumed some field names here.

 

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.

View solution in original post

It's returning empty gallery B results. I'm sure when we selected the line item in gallery A it showed available results in B. Screenshots below.GalleryB code.jpgGallery B search empty.jpg

@nchandran ,

The is something wrong with one of the criteria source values - the Filter is saying

Show all records from ConsumableWithdraw WHERE

  • The field MasterID matches the ID field selected in GalleryCRWelderInfo AND
  • If DropdownPartNo is not selected, do not filter further OR show the records for the PartNo Selected AND
  • If DropdownOrderNo is not selected, do not filter further OR show the records for the OrderNo Selected

What is not correct in the above?

 

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.

 

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (74,620)