cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

Delegation error using filter

Hello there!

I am getting an delegation error doing the following code. Is it possible to get this delegation error go away and still have the same result? Maybe using the GroupBy function? 

Screenshot of the delegation; https://gyazo.com/2a88d2152a00270f41101409463bbe9b

Here is the code that is giving a delegation error;

Filter(
                'Manco-Informatie',
                If(
                    selectedStatus = "All",
                    Verzender = gblFullName,
                    Verzender = gblFullName && (IsBlank(selectedStatus) || Status = selectedStatus)
                )
            )


The full code; 

Sort(
    Search(
        
        If(
            gblIsAdmin,
            If(
                selectedStatus = "All",
                'Manco-Informatie',
                Filter(
                    'Manco-Informatie',
                    IsBlank(selectedStatus) || Status = selectedStatus
                )
            ),
            Filter(
                'Manco-Informatie',
                If(
                    selectedStatus = "All",
                    Verzender = gblFullName,
                    Verzender = gblFullName && (IsBlank(selectedStatus) || Status = selectedStatus)
                )
            )
        ),
        TekstZoekVeld.Text,
        "Verzender",
        "Status",
        "Deelorder",
        "Extern",
        "Product",
        "Intern",
        "Datum",
        "Tekeningnummer",
        "Omschrijving",
        "VolledigTekeningNummer"
    ),
    'Ticket ID',
    If(
        SortDescending1,
        Ascending,
        Descending
    )
)

 

1 ACCEPTED SOLUTION

Accepted Solutions

This code worked, thank you! @iAm_ManCat ; 

Sort(
    Search(
        
        If(
            gblIsAdmin,
            If(
                selectedStatus = "All",
                'Manco-Informatie',
                Filter(
                    'Manco-Informatie',
                    IsBlank(selectedStatus) || Status = selectedStatus
                )
            ),
            If(
                    selectedStatus = "All",
                    Filter(
                'Manco-Informatie',
                    Verzender = gblFullName,
                    Verzender = gblFullName && (IsBlank(selectedStatus) || Status = selectedStatus)
                )
            )
        ),
        TekstZoekVeld.Text,
        "Verzender",
        "Status",
        "Deelorder",
        "Extern",
        "Product",
        "Intern",
        "Datum",
        "Tekeningnummer",
        "Omschrijving",
        "VolledigTekeningNummer"
    ),
    'Ticket ID',
    If(
        SortDescending1,
        Ascending,
        Descending
    )
)

 

View solution in original post

3 REPLIES 3
Super User II
Super User II

Hi @TimoMigchielsen ,

 

I think you need to wrap your If statement outside of the filter, just like you did for the data source above it:

 

Sort(
     Search(
            If(
               gblIsAdmin,
               If(
                  selectedStatus = "All",
                  'Manco-Informatie',
                  Filter(
                         'Manco-Informatie',
                         IsBlank(selectedStatus)
                         ||
                         Status = selectedStatus
                  )
               ),
               If(
                  selectedStatus = "All",
                  Filter(
                         'Manco-Informatie',
                         Verzender = gblFullName,
                  ),
                  Filter(
                         'Manco-Informatie',                      
                         Verzender = gblFullName
                         &&
                         (
                           IsBlank(selectedStatus)
                           ||
                           Status = selectedStatus
                         )
                  )
               )
            )
            ,
            TekstZoekVeld.Text,
            "Verzender",
            "Status",
            "Deelorder",
            "Extern",
            "Product",
            "Intern",
            "Datum",
            "Tekeningnummer",
            "Omschrijving",
            "VolledigTekeningNummer"
     ),
     'Ticket ID',
     If(
        SortDescending1,
        Ascending,
        Descending
     )
)

 

Let me know if that works for you,

 

Cheers,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Thank you for your answer @iAm_ManCat 

I get a lot of errors trying your code. For the Search & If operator

This code worked, thank you! @iAm_ManCat ; 

Sort(
    Search(
        
        If(
            gblIsAdmin,
            If(
                selectedStatus = "All",
                'Manco-Informatie',
                Filter(
                    'Manco-Informatie',
                    IsBlank(selectedStatus) || Status = selectedStatus
                )
            ),
            If(
                    selectedStatus = "All",
                    Filter(
                'Manco-Informatie',
                    Verzender = gblFullName,
                    Verzender = gblFullName && (IsBlank(selectedStatus) || Status = selectedStatus)
                )
            )
        ),
        TekstZoekVeld.Text,
        "Verzender",
        "Status",
        "Deelorder",
        "Extern",
        "Product",
        "Intern",
        "Datum",
        "Tekeningnummer",
        "Omschrijving",
        "VolledigTekeningNummer"
    ),
    'Ticket ID',
    If(
        SortDescending1,
        Ascending,
        Descending
    )
)

 

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (3,855)