cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

Is there an issue with MaxLength property for char() field typs in SQL server not enforcing the length?

I have an on-prem SQL server used via the Gateway.

 

I've noticed that if a field length is set by the server using the char() type, so char(32) means a 32 fixed width field, PowerApps may have an issue enforcing it. Here is what I have observed.

 

  1. MaxLength is retreived by this formula for the card property in an edit form:
    1. DataSourceInfo([@'[dbo].[tblAppItemDevelopment]'], DataSourceInfo.MaxLength, "ItemDescription2")
    2. That appears to be a correct formula. PowerApps generated it.
  2. User enters "This is a test". Because this is a fixed width field, SQL pads with spaces, so it becomes "This is a test           " (however many spaces to fill it up.
  3. Now, user edits the field. If they click near the end, say to replace "test" with "big test" PowerApps pushes all text to the right, and now the field has 36 chars in it. You cannot type 36 chars straight out, as it will properly truncate your last chars and only show the first 32. But if you go to the middle and type more, PowerApps doesn't seem to do anything to prevent it, or warn the user.
  4. User presses Submit, and it fails because the server is saying reporting the field is too long.

 

This seems to be a bug in the edit mode of a form. New mode works fine. Or is there something I am not seeing?

 

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Is there an issue with MaxLength property for char() field typs in SQL server not enforcing the length?

Hi @EdHansberry ,

 

I follow your description and test on my side, but I can't reproduce the NO.3 step.

What does “PowerApps pushes all text to the right” mean? In my test, I just can edit the text until to the Max length limitation. 

StoG_9.gif

Could you please share more screen shots or GIFs to show what matter with your form?

Best regards,

Sik

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,785)