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

Problem with Two dropdowns to filter gallery

I would like to have two dropdown list to filter the gallery based on Order No and PartNo but im getting syntax errors. Tried two different syntax in Distinct(Filter(ConsumableWithdraw, MasterID=GalleryCRWelderInfo.Selected.ID),Order=DropdownOrdNo.Selected,PartNo=DropdownPartNo.Selected) or tried Distinct(Filter(ConsumableWithdraw, OrderNo=DropdownOrdNo.Selected, PartNo=DropdownPartNo.Selected), MasterID=GalleryCRWelderInfo.Selected.ID) OrderNo and PartNo are columns from the sharepoint list called ConsumableWithdraw. Dropdown to search Order No is DropdownOrdNo & Dropdown to search Part No is DropdownPartNo.

MasterID gets the information from the ID in the primary Gallery GalleryCRWelderInfo. Screenshot below.

 

 

filtering error.jpg

 

 

10 REPLIES 10
v-bofeng-msft
Community Support
Community Support

Hi @nchandran :

Plese try this fromula:

Distinct(
   Filter(
      ConsumableWithdraw, 
      MasterID=GalleryCRWelderInfo.Selected.ID,
      Order=DropdownOrdNo.Selected,
      PartNo=DropdownPartNo.Selected
      )
)

Best Regards,

Bof

Hi it doesn't work, still getting the red swiggilies.

Hi @nchandran :

Could you tell me:

What is Order and PartNo's data type?

What is DropdownOrdNo and DropdownPartNo?What are they items property?

Please try:

Distinct(
   Filter(
      ConsumableWithdraw,
      MasterID=GalleryCRWelderInfo.Selected.ID,
      Order=DropdownOrdNo.Selected.ColumnName,
      PartNo=DropdownPartNo.Selected.ColumnName
      )
)

Because of the lack of information, I cannot be sure that my answer is 100% correct.If there is still an error, could you consider providing more details?

Best Regards,

Bof

For  both Dropdown , items is ConsumableWithdraw.

Hi @nchandran :

Please try this formula:

Distinct(
   Filter(
      ConsumableWithdraw, 
      MasterID=GalleryCRWelderInfo.Selected.ID,
      Order=DropdownOrdNo.Selected.Order,
      PartNo=DropdownPartNo.Selected.PartNo
      )
)

Best Regards,

Bof

 

I got this screenshot. Error is still there. Master ID is a lookup column (belongs to secondary sharepoint list) which points taps on ID column belonging to primary sharepoint list.

nchandran_0-1606473868017.png

 

 

Hi @nchandran :

I’m not sure what your reason for using Distinct is, I assume you want to de-duplicate according to Title column.

Please try this formula:

ForALL(
  RenameColumns(Distinct(
     Filter(
        ConsumableWithdraw, 
        MasterID.value=GalleryCRWelderInfo.Selected.ID,
        Order=DropdownOrdNo.Selected.Order,
        PartNo=DropdownPartNo.Selected.PartNo
        ),
      Title
  ),"ID","IDD")
  LookUp(ConsumableWithdraw, ID=IDD)
)

 Best Regards,

Bof

nchandran
Helper V
Helper V

Getting this error.

 

nchandran_0-1606711290647.png

 

v-bofeng-msft
Community Support
Community Support

Hi @nchandran :

You don't seem to use the formula I provided.

ForALL(
  RenameColumns(Distinct(
     Filter(
        ConsumableWithdraw, 
        MasterID.value=GalleryCRWelderInfo.Selected.ID,
        Order=DropdownOrdNo.Selected.Order,
        PartNo=DropdownPartNo.Selected.PartNo
        ),
      Title
  ),"ID","IDD")
  LookUp(ConsumableWithdraw, ID=IDD)
)

From the screenshot, the reason for the error is that Distinct uses the wrong syntax.

Distinct( Table, Formula )

I think this link will help you a lot:

Distinct function in Power Apps 

Best Regards,

Bof

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (61,864)