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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Adding code to ignore ...
Power Apps
Unanswered

Adding code to ignore filter

(0) ShareShare
ReportReport
Posted on by 421

Hi everyone.  I am filtering a table to only display items that are instock on our online store.

 

Search(
Filter(
'Depot-Partss',
IsBlank(ComboBox1.Selected.Value) || IsEmpty(ComboBox1.Selected.Value) || crd63_partvendor = ComboBox1.Selected.Value,
crd63_qtyonhand > 0,
IsBlank(ComboBox2.Selected.Value) || IsEmpty(ComboBox2.Selected.Value) || crd63_arparts = ComboBox2.Selected.Value,
crd63_qtyonhand > 0
),
TextInput1.Text,
"cr3db_crd63_partname"
)

 

However I need to add in some code to ignore the crd63_qtyonhand > 0 if crd63_arparts = "AR" or crd63_arparts = "Embed Repair".  These items are not counted the same way in our warehouse so they are always instock.

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

    Hi @ckserra33 ,

    Is this what you are after ?

    Search(
     Filter(
     'Depot-Partss',
     (
     crd63_arparts = "AR" || 
     crd63_arparts = "Embed Repair"
     ) &&
     (
     crd63_qtyonhand > 0 &&
     (
     Len(ComboBox1.Selected.Value) = 0 || 
     crd63_partvendor = ComboBox1.Selected.Value
     ) &&
     (
     Len(ComboBox2.Selected.Value) = 0 ||
     crd63_arparts = ComboBox2.Selected.Value
     )
     )
     ),
     TextInput1.Text,
     "cr3db_crd63_partname"
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • ckserra33 Profile Picture
    421 on at

    Hi @WarrenBelz , thank you for the reply.  So when I try this code, it will only show AR, it wont show parts or used parts.  Ideally, I would like it to always show Embed Repair or AR, even if the qtyonhand is not >0.  Parts and Used parts should only be effected by the qtyonhand >0.

  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @ckserra33 ,

    A bit of a brain bender, but I think this will do it

    Search(
     Filter(
     'Depot-Partss',
     (
     crd63_qtyonhand > 0 &&
     (
     Len(ComboBox1.Selected.Value) = 0 || 
     crd63_partvendor = ComboBox1.Selected.Value
     ) &&
     (
     Len(ComboBox2.Selected.Value) = 0 ||
     crd63_arparts = ComboBox2.Selected.Value
     )
     ) &&
    	 (
     Len(ComboBox2.Selected.Value) = 0 ||
    	 (
     crd63_arparts = "AR" || 
     crd63_arparts = "Embed Repair"
     )
     )		 
     ),
     TextInput1.Text,
     "cr3db_crd63_partname"
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • ckserra33 Profile Picture
    421 on at

    Hi @WarrenBelz , Thanks again for the response.  So now with no items in the dropdown, I see all the items, AR, EMbed Repair, Used parts and Parts, however whenever I choose parts or used parts from the dropdown it shows the gallery blank.  AR works correctly.

  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    @ckserra33 ,

    Try an or || instead of and && in the last reference, but this is my best effort without data to actually test it on.

  • ckserra33 Profile Picture
    421 on at

    Hi @WarrenBelz Thank you for your help so far.  I worked on it this morning with the help of Chat GPT and came up with this.  It has a delegation warning on the IF statement.  Will this effect my Datasource filtering once I go over 2000 records?

    ckserra33_0-1684837470508.png

     

  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    @ckserra33 ,

    I generally do not comment on AI "solutions", but no - it is not Delegable and why I have tried to structure my responses in the manner posted. You can probably take out the second Combo Box reference, and do this

    Search(
     Filter(
     'Depot-Partss',
     (
     crd63_qtyonhand > 0 &&
     (
     Len(ComboBox1.Selected.Value) = 0 || 
     crd63_partvendor = ComboBox1.Selected.Value
     ) &&
     (
     Len(ComboBox2.Selected.Value) = 0 ||
     crd63_arparts = ComboBox2.Selected.Value
     )
     ) ||
     crd63_arparts = "AR" || 
     crd63_arparts = "Embed Repair"	 
     ),
     TextInput1.Text,
     "cr3db_crd63_partname"
    )

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard