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

Storing data containing "/"

Hi,

 

I have created an app to capture insurance policy numbers with database in SQL Server Express Edition. The challenge users are facing that if the policy numbers contains special characters like "/" or "-" , the data is not being stored in the table. I have used following column properties for the column:

  • Varchar
  • nvarchar
  • Text

Whenever the users are saving a number .. let's say A/454545/45/0123/00007 , the app is not storing it and the value in the data table is null.

 

Please advise.

 

Thanks,

Vivek

1 ACCEPTED SOLUTION

Accepted Solutions

@v-xida-msft@CarlosFigueira

 

Thank you for your responses.

 

I deleted the existing field and added it as new, and it resolved the issue. Did not make any other change in the database or the app.

 

This is not the first time something like this has happened though. I had encountered similar issues in the past, where certain properties of the datacard are not working the way they intended to. And everytime removing and adding it back again solves the issue. I am not sure if there is any bug in the program.

 

Thanks,

Vivek

View solution in original post

3 REPLIES 3
Power Apps
Power Apps

This should not be a problem; how are you storing this data into the SQL table (forms, Patch, Collect)? Can you post any expression that you're using to store the data?

Community Support
Community Support

Hi @vranjan22,

Could you please share a screenshot about your app's configuration?

How do you save the insurance policy numbers into your SQL table within your app? Using SubmitForm function or Patch function?

Are the other columns (except the InsuranceNum column) stored in your SQL table successfully?

I have made a test on my side (generate an app based on my SQL table), and don't have the issue that you mentioned. The GIF screenshot as below:Test1.gif

The insurance policy number stored successfully in my SQL table:
2.JPG

Note: The InsuranceNum column is a varchar type (varchar(50)) column in my SQL table. 

In addition, you could also consider take a try to submit your form data into your SQL table using Patch function:

Patch(
'[dbo].[Insurances]',
Defaults('[dbo].[Insurances]'),
{
UserName: DataCardValue5.Text,
InsuranceNum: DataCardValue4.Text,
ExpiryDate: ExpiryDate_DataCard2.Default
}
)

On your side, you should type:

Patch(
'[dbo].[YourSQLTable]',
Defaults('[dbo].[YourSQLTable]'),
{
Column1: DataCardValue1.Text,
...
InsuranceNum: DataCardValue4.Text,
Column6: DataCardValue6.Text,
...
}
)

More details about the Patch function in PowerApps, please check the following article:

Patch function

 

Please check if you have defined a PRIMARY KEY in your SQL table, if not, please define a primary key within your SQL table, then check if the issue is solved.

In addition, please also consider take a try to turn off/disable the "Explicit column selection" option within Advanced settings of App settings, then re-publish your app, check if the issue still exists.

 

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.

@v-xida-msft@CarlosFigueira

 

Thank you for your responses.

 

I deleted the existing field and added it as new, and it resolved the issue. Did not make any other change in the database or the app.

 

This is not the first time something like this has happened though. I had encountered similar issues in the past, where certain properties of the datacard are not working the way they intended to. And everytime removing and adding it back again solves the issue. I am not sure if there is any bug in the program.

 

Thanks,

Vivek

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (46,647)