web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / On Dataverse delegatio...
Power Apps
Answered

On Dataverse delegation for supported formulas?

(1) ShareShare
ReportReport
Posted on by 15
Hi, everyone. Hoping you can help on this one. 
 
I am using Dataverse as a Data source to develop a Gym app for tracking exercises and what not. In it, I have the following code in the OnVisible of a screen:
 
//Collection to get all exercises in the current workout selected
ClearCollect(
    WorkoutSelectedExerciseDetail,
    ShowColumns(
        AddColumns(
            Filter(
                'Workout Details',
                Workouts.Workouts = galWorkoutsMain.Selected.Workouts && 'Created By'.'Primary Email' = User().Email
            ),
            tmp_exerciseName,
            Exercises.Name
        ),
        tmp_exerciseName
    )
);
 
// Collection to populate combobox with all exercises not in Workout
ClearCollect(
    workoutSelectedComboexercises,
    Filter(
        Exercises,
        'Created By'.'Primary Email' = User().Email And IsBlank(
            LookUp(
                WorkoutSelectedExerciseDetail,
                tmp_exerciseName = Name
            )
        )
    )
);
 
What this does is basically create a collection [WorkoutSelectedExerciseDetail] which helps me select all the Exercises in a given workout. Then [workoutSelectedComboexercises] is expected to compare those exercises against all the exercises available in the [Exercises] table and only show those which are not in the workout yet, like in screenshot1. However, you can see I am getting delegation errors with Lookup, filter, countrows, blank(), etc. when these functions are supposed to be delegable [Screenshot2]. I am comparing 2 texts.
 
Am I missing something? I am trying to get rid of that delegation error trying as many alternatives as possible, but I am a bit dumbfounded as to what is causing this delegation issue. Thank you!
screenshot2.jpg
screenshot1.jpg
Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
    Hi,
     
    So those are not delegatable, so you have to decide how best to do it based on how many rows you have in the list/table you have.
     
    Does the Exercise table have more than 2000 rows?
    Does the WorkoutSelectedComboexercises have more than 2000 rows?
     
    If neither has more than 2000 rows and if you set the Delegation Setting from 500 to 2000 then you can ignore these warnings.
    • If Exercises has more than 2000 rows then I would do this.
    • So in this it will pre-filter the Exercises by just the User Email which should not cause any delegation errors
    • Then it further filters by the above pre-filter records.
    Since I cannot believe the user will have 2000 rows of their own(is that possible???), then any delegation you can further down can be ignored.
     
    ClearCollect(
        workoutSelectedComboexercises,
    	With(
    	  { CurrentUserExercises: Filter(Exercises, 'Created By'.'Primary Email' = User().Email},
    	  
    		Filter(
    			CurrentUserExercises,
    			IsBlank(LookUp(WorkoutSelectedExerciseDetail, tmp_exerciseName = Name)
    				)
    			)
    		)
        );
    );
     
     
     
     
     
  • EdGandalf Profile Picture
    15 on at
    Hey, Michael, genius! Thank you so much for the help, I am not that familiar with "With", didn't occur to me to use it.
     
    Say, regarding the delegation, what part of the previous formula was not delegable? I thought the formula was compliant with the rules in https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/connections/connection-common-data-service#power-apps-delegable-functions-and-operations-for-dataverse.
  • Suggested answer
    venturemavenwill Profile Picture
    1,193 Super User 2026 Season 1 on at
    I believe you are misunderstanding delegable functions
     
    Lookup is delegable, so is Filter. However, what you are currently trying to do is to make PowerApp perform a secondary query, which it correctly indicates is not delegable. 
     
    The good news is that the "in" and "not" operators are delegable in Dataverse. 
     
    So based on your formula, try to do something like:
     
    Filter(
       Exercises,
       'Created By'.'Primary Email' = User().Email,
       Not( Name in WorkoutSelectedExerciseDetail.tmp_exerciseName )
    )
    The strategy is that a collection is local and doesn't need to be delegated, so you can simply check if the Name exists in the collection. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard