cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Error filtering on SQL view: An identifier was expected at position 52.

I have a grid where the items selected are being filtered based on the value selected in a dropdown and toggle control as shown below.

Screenshot - 7_24_2018 , 12_46_42 PM.png

 

The dropdown items are coming from '[Active].[Model]', displaying the ModelName (nothing fancy).  The grid is pulling items from a SQL view and the  Items property on the grid is really straight forward:  

 

Filter(
    '[Active].[vwModelReasonCodes]',
    ModelId = Dropdown8.Selected.ModelId,
    IsScrapReason = If(Toggle2.Value, 1, 0)
    )

When I comment out the first filter expression, everything works great, but when I include it, I get this error: "An identifier was expected at position 52."  What's even more strange is that the app works great in the designer but not in the PowerApps desktop app, or when using the app in the browser.

 

 

In doing a bit more troubleshooting, I opened the browser dev toolbar and found some strange behavior.  The request to get the data from vwModelReasonCodes looks like this:

To make it easier to read I've decoded the query parameters below:

  • $filter: (ModelId eq 23)and(IsScrapReason eq 0)
  • $select: IsScrapReason,ModelName,ReasonText,FaultDescription,57dfb1b5-7d79-4046-a4da-fd831d5befe1-KeyId
  • $top: 100

 

I assume this is producing a SQL statement that looks something like this:

SELECT TOP 100 

    IsScrapReason,ModelName,ReasonText,FaultDescription,57dfb1b5-7d79-4046-a4da-fd831d5befe1-KeyId

FROM [Active].[vwModelReasonCodes]

WHERE (ModelId eq 23)and(IsScrapReason eq 0)

 

So I'll state the obvious that there is no column named "57dfb1b5-7d79-4046-a4da-fd831d5befe1-KeyId" in my view.

 

Again, this problem goes away as soon as I comment out the "ModelId = Dropdown8.Selected.ModelId" filter.

 

Any help with this would be very much appreciated!

 

HAR file attached for reference.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Error filtering on SQL view: An identifier was expected at position 52.

Hi @mcandelo,

 

Could you please share a bit more about the error message within your app?

 

I have made a test on my side and don't have the issue that you mentioned.

 

The user @ORYXIT and @bobed have faced same issue with you, please check the following threads:

https://powerusers.microsoft.com/t5/General-Discussion/Error-when-app-starting/td-p/105618

 

https://powerusers.microsoft.com/t5/Connecting-to-Data/The-requested-operation-is-invalid-Server-Res...

 

Please check if you have enabled/turned on the "Explicit Column Selection" option within the Advanced Settings of App settings (App settings-> Advanced Settings-> "Explicit Column Selection" option), if yes, please take a try to disable/turned off the this option, then check if the issue is solved.

3.JPG

 

Best regards,

Kris

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

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Error filtering on SQL view: An identifier was expected at position 52.

Hi @mcandelo,

 

Could you please share a bit more about the error message within your app?

 

I have made a test on my side and don't have the issue that you mentioned.

 

The user @ORYXIT and @bobed have faced same issue with you, please check the following threads:

https://powerusers.microsoft.com/t5/General-Discussion/Error-when-app-starting/td-p/105618

 

https://powerusers.microsoft.com/t5/Connecting-to-Data/The-requested-operation-is-invalid-Server-Res...

 

Please check if you have enabled/turned on the "Explicit Column Selection" option within the Advanced Settings of App settings (App settings-> Advanced Settings-> "Explicit Column Selection" option), if yes, please take a try to disable/turned off the this option, then check if the issue is solved.

3.JPG

 

Best regards,

Kris

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

Highlighted
New Member

Re: Error filtering on SQL view: An identifier was expected at position 52.

Turning off the Explicit Column Selection option solved the problem, thank you!

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,688)