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

"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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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

Welcome to the User Group Public Preview

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (52,445)