cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
james_riach
Level: Powered On

Delegation Formula Help

Hello,

 

I have a PowerApp which has been built and is in use currently in our company but we are likely to reach the 2000 delegation limit shortly so I have been trying to look into a way to adjust the formula used to avoid delegation. Unfortunately I have had no joy in creating a working method to still sort and filter on what we need but avoid delegation too. Any help on this would be much appreciated.

 

Please see the code we are currently using below:

 

SortByColumns(
  Filter(
    Filter(
      Filter(
        Sort(
          Sort(
            Sort(
              Sort(
                'LFF UK IT Task List',
                Text('Sub Theme'.Value)
            ),
           Text('Business Theme'.Value)
        ),
       Text(Dept.Value)
       ),
       Text(Sponsor.Value),
       Ascending
     ),
     If(
         ViewDrp.SelectedText.Value = "All Items",
         true,
         ViewDrp.SelectedText.Value in Status.Value
      ) || If(
         ViewDrp.SelectedText.Value = "All Live",
         Status.Value <> "06. Complete" && Programme.Value = "No",
         ViewDrp.SelectedText.Value in Status.Value
      ) || If(
        ViewDrp.SelectedText.Value = "Live AB",
        Status.Value <> "06. Complete" && "AB" in 'Who Int'.Value && Programme.Value = "No",
        ViewDrp.SelectedText.Value in 'Who Int'.Value
      ) || If(
        ViewDrp.SelectedText.Value = "Live AF",
        Status.Value <> "06. Complete" && "AF" in 'Who Int'.Value && Programme.Value = "No",
        ViewDrp.SelectedText.Value in 'Who Int'.Value
      ) || If(
        ViewDrp.SelectedText.Value = "Live CC",
        Status.Value <> "06. Complete" && "CC" in 'Who Int'.Value && Programme.Value = "No",
        ViewDrp.SelectedText.Value in 'Who Int'.Value
      ) || If(
        ViewDrp.SelectedText.Value = "Live JH",
        Status.Value <> "06. Complete" && "JH" in 'Who Int'.Value && Programme.Value = "No",
        ViewDrp.SelectedText.Value in 'Who Int'.Value
      ) || If(
        ViewDrp.SelectedText.Value = "Live JS",
        Status.Value <> "06. Complete" && "JS" in 'Who Int'.Value && Programme.Value = "No",
        ViewDrp.SelectedText.Value in 'Who Int'.Value
      ) || If(
        ViewDrp.SelectedText.Value = "Live MN",
        Status.Value <> "06. Complete" && "MN" in 'Who Int'.Value && Programme.Value = "No",
        ViewDrp.SelectedText.Value in 'Who Int'.Value
      ) || If(
        ViewDrp.SelectedText.Value = "Live SH",
        Status.Value <> "06. Complete" && "SH" in 'Who Int'.Value && Programme.Value = "No",
        ViewDrp.SelectedText.Value in 'Who Int'.Value
      )
    ),
    Status.Value in StatusCombo.SelectedItems.Value
   ),
    TextSearchBox1.Text in 'IT ID' || TextSearchBox1.Text in 'Project/Task'
 ),
  SortColumn,
  If(
     SortDecending,
     Ascending,
     Descending
  )
)

 

Thanks.

2 REPLIES 2
Super User
Super User

Re: Delegation Formula Help

@james_riach 

I do not know the answer to your problem but I do want to share a tip to help shorten your code.  This code segment...

 

If(
ViewDrp.SelectedText.Value = "All Items",
true,
ViewDrp.SelectedText.Value in Status.Value
) || If(
ViewDrp.SelectedText.Value = "All Live",
Status.Value <> "06. Complete" && Programme.Value = "No",
ViewDrp.SelectedText.Value in Status.Value
) || If(
ViewDrp.SelectedText.Value = "Live AB",
Status.Value <> "06. Complete" && "AB" in 'Who Int'.Value && Programme.Value = "No",
ViewDrp.SelectedText.Value in 'Who Int'.Value
) || If(
ViewDrp.SelectedText.Value = "Live AF",
Status.Value <> "06. Complete" && "AF" in 'Who Int'.Value && Programme.Value = "No",
ViewDrp.SelectedText.Value in 'Who Int'.Value
) || If(
ViewDrp.SelectedText.Value = "Live CC",
Status.Value <> "06. Complete" && "CC" in 'Who Int'.Value && Programme.Value = "No",
ViewDrp.SelectedText.Value in 'Who Int'.Value
) || If(
ViewDrp.SelectedText.Value = "Live JH",
Status.Value <> "06. Complete" && "JH" in 'Who Int'.Value && Programme.Value = "No",
ViewDrp.SelectedText.Value in 'Who Int'.Value
) || If(
ViewDrp.SelectedText.Value = "Live JS",
Status.Value <> "06. Complete" && "JS" in 'Who Int'.Value && Programme.Value = "No",
ViewDrp.SelectedText.Value in 'Who Int'.Value
) || If(
ViewDrp.SelectedText.Value = "Live MN",
Status.Value <> "06. Complete" && "MN" in 'Who Int'.Value && Programme.Value = "No",
ViewDrp.SelectedText.Value in 'Who Int'.Value
) || If(
ViewDrp.SelectedText.Value = "Live SH",
Status.Value <> "06. Complete" && "SH" in 'Who Int'.Value && Programme.Value = "No",
ViewDrp.SelectedText.Value in 'Who Int'.Value
)

 

Can be changed into this which I feel is much more readable.

 

If(
    ViewDrp.SelectedText.Value in ["All Items","All Live","Live AB","Live AF","Live CC","Live JH","Live JS","Live MN","Live SH"],
    Status.Value <> "06. Complete" && Programme.Value = "No",
    ViewDrp.SelectedText.Value in Status.Value
) || 
If(
    ViewDrp.SelectedText.Value = "All Items",
    true,
    ViewDrp.SelectedText.Value in Status.Value
)

 

Please note: I had trouble reading your code because of the indentation.  Maybe if you can clean that up a bit it will make it easier for the forum to analyze your code.  Not trying to be rude here.  Just a friendly suggestion.

james_riach
Level: Powered On

Re: Delegation Formula Help

Thank you for your help @mdevaney . I will try and use your method in the future to keep it tidier.

 

I have also tried to add the indentations in my original message as it appears in the PowerApp formula bar to try and make it clearer. Sorry I just copied and pasted it straight from PowerApps before.

 

If anyone can help me with changing this code to avoid delegation limits that would be great.

 

Thanks

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,933)