cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alex93jansen
Helper II
Helper II

"The requested operation is invalid - Expression expected" Race condition on App launch

So my PowerApp works exactly as expected. However, when launching it I'm initially receiving the error below prior to the data being loaded:

The requested operation is invalid. Server Response: [dbo].[tmtrak_dev_records] failed: Expression expected at position 61 in '(submittedBy eq user@email.com)and(activityDate eq ())'. inner exception: Expression expected at position 61 in '(submittedBy eq <user>)and(activityDate eq ())'. clientRequestId: a4af8601-10eb-4bbc-a2d5-1b06b81f4c42

"submittedBy" and "activityDate" are SQL fields compared against the variables "userEmail" and "mondayDate" which both are OnStart variables, calculated as follow:

Set(userEmail, User().Email); 

Set(mondayDate, Today() - (Weekday(Today(), StartOfWeek.Monday) - 1));

and used to filter data from my SQL table:

Concatenate(
    "Hours: ",
    Text(
        Sum(
            Filter(
                '[dbo].[tmtrak_dev_records]',
                submittedBy = userEmail,
                activityDate = mondayDate
            ),
            Value(activityHours)
        )
    )
)

 

alex93jansen_1-1614842565653.png

My App works totally fine, but it appears it's attempting to load data before the "mondayDate" value is available.

I have already disabled "Use non-blocking OnStart rule" and "Explicit column selection" under Advanced settings, but the issue is still occurring.

 

Is there a way to guarantee the App will not load the initial screen before OnStart variables have been set?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

I have already disabled that setting but the issue continues to persist.

 

For now I have a blank landing screen which re-directs to my other screen after .2sec as a work-around solution, but it isn't a clean solution to my issue.

View solution in original post

2 REPLIES 2
RandyHayes
Super User III
Super User III

@alex93jansen 

Consider setting the Use non-blocking OnStart rule to be off in the advanced settings of your app:

RandyHayes_0-1614867626503.png

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I have already disabled that setting but the issue continues to persist.

 

For now I have a blank landing screen which re-directs to my other screen after .2sec as a work-around solution, but it isn't a clean solution to my issue.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,001)