cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yakimo
Level: Powered On

Field name with "-" char

Hi again

 

I try to make a simple app from a SQL database

Unfortunately for me, one of the table fields is named "MA-nr", and it seems the minus in the filedname causes the problem

 

Working perfect:

 

SortByColumns(Search('[dbo].[Personale]', TextSearchBox2.Text, "Name"), "Name", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

 

 

Changing sorting 'Name' with 'MA-nr' Gives an error: "The requested operation is invalid. Server Response: Syntax error at position 3 in 'MA-nr asc'

 

 

SortByColumns(Search('[dbo].[Personale]', TextSearchBox2.Text, "Name"), "MA-nr", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

 

It seems that the problem comes from field name 'MA-nr'

I tried to use the name in brackets and apostrophe, but without luck

Unfortunately I cannot change the field name in the table,because it is in use many other places and applications

 

Any idea how to overcome this obstacle?

The screenshot follow:

Capture.PNG

 

regards,

yakimo

 

 

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Field name with "-" char

Hi @Yakimo,

 

Thanks for the feedback.

Issue confirmed from my side.

19.PNG

I will send this to the proper team.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Community Support Team
Community Support Team

Re: Field name with "-" char

Hi @Yakimo,

 

I have some feedbacks on this issue.

This issue is caused by SQL Server connector, currently connectors would only translate the function (filter, sort and so on ) into OData Query, and OData Query doesn't support parameter like '-'.

There would be updates on this, and no ETA could be shared at this time.

Ther error would occur because there is query sent back to the server, a workaround to clear the error is to make the formula without delegation, for example:

SortByColumns(
              Filter('[dbo].[Test]', 
                        Text('Tes-re') = TextSearchBox1.Text), 
              "Tes-re", 
             If(SortDescending1, 
               Descending, 
               Ascending)
     )

25.PNG

Another way is to store the data into a local collection, or switch the App in Offline mode.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yakimo
Level: Powered On

Re: Field name with "-" char

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,687)