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 / Toggle Not Filtering D...
Power Apps
Unanswered

Toggle Not Filtering Datatable

(0) ShareShare
ReportReport
Posted on by 254

Hi 

 

I have a Datatable that pulls back all the Delivery notes from a Part number.  It uses the below formula:

 

With({aFilter: Filter('Tbl Delivery Dev2','ORDER REF'=POTableDescrip_1.Selected.'ORDER REF')},
Filter(aFilter,
If(TogDesPO2.Value,'ORDER REF'=POTableDescrip_1.Selected.'ORDER REF',true),
If(TogDesDelivery2.Value,STATUS="Delivered",true)
)
)

 

I have a toggle(TogDesPO2.Value) that looks at another datatable, which contains Purchase Order numbers for the same part number.

 

When the toggle is off it should bring back all the delivery notes for that part number, which it doesn't.  When the toggle is on, it should only show the delivery notes for the selected Purchase Order number, which it does.

 

Any help would be appreciated.

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    @Skybluekid,

     

    You prefilter the table by order reference and then run the same order reference filter condition on the filtered dataset only if a toggle is set to true. I don't think the With() function is necessary here, could you try the following adjustment:

    Filter(
     'Tbl Delivery Dev2',
     //Or toggle is false, or filter by order ref
     !TogDesPO2.Value || 'ORDER REF'=POTableDescrip_1.Selected.'ORDER REF',
     !TogDesDelivery2.Value || STATUS="Delivered"
    )
    

    The code above also avoids the If statement that could cause issues (delegation warnings & true output that does not return any records).

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • Skybluekid Profile Picture
    254 on at

    Thanks @LaurensM 

    I think I made a slight error when describing.  What I should have said is that if in the PO Table it has returned two PO for a part number, the unfiltered Delivery note table should return all delivery notes for those two PO's only, not all delivery notes in the list.  Then if the TogDesPO2 is switched to true then only the selected value delivery notes are displayed.

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Skybluekid,

     

    As I understand it now the initial With filter is necessary. However, the initial filter also filters on the selected reference from POTableDescrip_1 - to my understanding this should be the Part Number filter. Below you can find a sketch of the possible architecture:

     

    With(
     {
     //Filter by part number
     aFilter: Filter('Tbl Delivery Dev2',PartNumberColumn = PartNumberValue)
     },
     Filter(
     aFilter,
     //Or toggle is false, or filter by order ref
     !TogDesPO2.Value || 'ORDER REF' = POTableDescrip_1.Selected.'ORDER REF',
     !TogDesDelivery2.Value || STATUS = "Delivered"
     )
    )

    Please adjust PartNumberColumn to the correct column name and PartNumberValue to the current part number value.

     

    I hope this helps!

  • Skybluekid Profile Picture
    254 on at

    @LaurensM 

     

    Thank you very much

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 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard