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

How can I Fix this Delegation Warning

Hey guys,
I'm having a "problem" with delegation. I've already gone through the numerous threads on this issue but they didn't help me find a workaround/other solution.
I'm currenly building a simple apps to query the data from sharepoint list.

For example, I'm using the following formula to filter the data by the user inputs. The warning occurs.How will I fix this? Any recommendations please. See the Screenshot for better understanding. Thank you very much

 

 

Set(
    Vstatus,
    Dropdown5.Selected.Ivalue
);
ClearCollect(
    MyRequestList,
    Filter(
        Contract,
        CurrentUserEmail = 'Requestor Mail',
        If(
            !IsBlank(Vstatus),
            Vstatus = 'Form Status',
            true
        ),
        If(
            !IsBlank(TextInput9.Text),
            StartsWith(
                'Form NO.',
                TextInput9.Text
            ),
            true
        )
    )
)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: How can I Fix this Delegation Warning

@Qing 

You'll need to recode those IF statements to do the same thing but using a slightly different method

Set(
    Vstatus,
    Dropdown5.Selected.Ivalue
);
ClearCollect(
    MyRequestList,
    Filter(
        Contract,
        CurrentUserEmail = 'Requestor Mail',
        !IsBlank(VStatus) = true Or Vstatus = 'Form Status',
        !IsBlank(TextInput9.Text) = true Or StartsWith('Form NO.',TextInput9.Text)
    )
)

 

Here's a link to my forum post a week ago where I helped with a similar issue.  I put my pattern for avoiding delegation there.  You can bookmark to it for future reference.

 https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Filtering-on-multiple-fields/m-p/40...

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up.

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: How can I Fix this Delegation Warning

@Qing 

You'll need to recode those IF statements to do the same thing but using a slightly different method

Set(
    Vstatus,
    Dropdown5.Selected.Ivalue
);
ClearCollect(
    MyRequestList,
    Filter(
        Contract,
        CurrentUserEmail = 'Requestor Mail',
        !IsBlank(VStatus) = true Or Vstatus = 'Form Status',
        !IsBlank(TextInput9.Text) = true Or StartsWith('Form NO.',TextInput9.Text)
    )
)

 

Here's a link to my forum post a week ago where I helped with a similar issue.  I put my pattern for avoiding delegation there.  You can bookmark to it for future reference.

 https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Filtering-on-multiple-fields/m-p/40...

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up.

View solution in original post

Highlighted
Dual Super User III
Dual Super User III

Re: How can I Fix this Delegation Warning

Another approach to fixing this that can be useful in complex filtering scenarios is to next the filters.  Since the delegation warning is only on one of the clauses in your filter you can also fix it by adding a filter within a filter.  Use the inner filter with the parts that don't cause a delegation warning.  If that will get your record count below the limit then you can safely ignore the warning.  In your case I suspect that the filter on current user alone may get you below the 500 record limit.  So you could try this filter.

Set(
    Vstatus,
    Dropdown5.Selected.Ivalue
);
ClearCollect(
    MyRequestList,
    Fliter(
        Filter(
            Contract,
            CurrentUserEmail = 'Requestor Mail'),
        If(
            !IsBlank(Vstatus),
            Vstatus = 'Form Status',
            true
        ),
        If(
            !IsBlank(TextInput9.Text),
            StartsWith(
                'Form NO.',
                TextInput9.Text
            ),
            true
        )
    )
)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Regular Visitor

Re: How can I Fix this Delegation Warning

That is not a solution, if the collect ton give the warning neither should the source, Microsoft needs to fix this give us a toggle or something.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

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

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,825)