cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
james_riach
Advocate III
Advocate III

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.

10 REPLIES 10
v-xida-msft
Community Support
Community Support

Hi @james_riach ,

Could you please share a bit more about the 'LFF UK IT Task List' data source? Is it a SP List?

 

Based on the screenshot that you mentioned, I think this issue is related to the 'Sub Theme' field (Choice type field) in your SP List data source.

 

Currently, the Choice type field is not delegable within Sort function. Please check the following article for more details:

https://docs.microsoft.com/en-us/connectors/sharepointonline/#powerapps-data-type-mappings

 

If you want to get rid of the Delegation warning issue within your formula, I afraid that there is no direct way to achieve your needs in PowerApps currently.

As an alternative solution, you could consider create a Calculated field for each Choice type field in your 'LFF UK IT Task List' SP List. Set the Formula box for each Calculated field to following:

=[Sub Theme]
=[Business Theme]

...

Then within your formula, please use the Calculated field as Sort column within your Sort formula intead of the original Choice type fields, then check if the issue is solved.

 

Also please check and see if the alternative solution I provided within the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/Building-PowerApps-Formerly/Sort-gallery-with-multiple-fields/td...

 

Please consider take a try with the following workaround, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

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 the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (39,810)