cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oskarkuus
Post Prodigy
Post Prodigy

Error in filter - the right side of the equal operator must be a constant value ?

I have often problem with this error message.
"the right side of the equal operator must be a constant value"

Sometimes stuff just work but the error is still there.

Now i have this:
Filter(ev_datasource;lev_user.'Primär e-post' = User().Email ; 1 = lev_lastStatus_num )

I have changed things around on both sides of the = sign. I have put in an AND operator and an OR operator.

 

It works fine if i remove one of the statements in the filter but i can not have 2...

 

How to fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

Best practices would call for making two changes.

Set(CurrentEmail = User().Email);;
Filter(ev_datasource;lev_user.'Primär e-post' = CurrentEmail ; lev_lastStatus_num = 1 )
  1.   Using a function inside a filter, like User().Email will lead to a delegation warning.  Its better to store the value in a variable at some point in the app and then use the variable in the filter.
  2. Your second criteria should be the other way around.  That I believe is what is causing the error message.  The static value should always be on the right side of the equal. 


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

1 REPLY 1
Pstork1
Dual Super User
Dual Super User

Best practices would call for making two changes.

Set(CurrentEmail = User().Email);;
Filter(ev_datasource;lev_user.'Primär e-post' = CurrentEmail ; lev_lastStatus_num = 1 )
  1.   Using a function inside a filter, like User().Email will lead to a delegation warning.  Its better to store the value in a variable at some point in the app and then use the variable in the filter.
  2. Your second criteria should be the other way around.  That I believe is what is causing the error message.  The static value should always be on the right side of the equal. 


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,569)