Hello,
I'm facing an issue with a form where I have to submit a numeric value which can be decimals to the SQL DB and it's not handling it very well. If the column in the SQL DB is set to Decimal or Numeric, Powerapps throws an error saying it cannot convert NVARCHAR to Numeric, if the SQL DB Columns are set to Int, it saves the numbers but ignores the decimals...
How should I be handling the Decimals in powerapps as it seems to firmly believe (although i set the text format to numeric) that it should patch the numbers as NVARCHAR?
Solved! Go to Solution.
Hi @jbrit2020
Could it be the case that your fields were nvarchar to begin with, and you later changed them to decimal or int? If that's the case, have you you refreshed the data source?
If your source field is numeric, you should patch a numeric value, not a string value. To make sure that you're patching a number, you can call the value function against the input value that you want to save. For example,
Value(txtInputValueToPatch.Text)
Hi @jbrit2020
Could it be the case that your fields were nvarchar to begin with, and you later changed them to decimal or int? If that's the case, have you you refreshed the data source?
If your source field is numeric, you should patch a numeric value, not a string value. To make sure that you're patching a number, you can call the value function against the input value that you want to save. For example,
Value(txtInputValueToPatch.Text)
@timl that worked and was the solution for the main issue.
Afterwards I only had to deal with empty field submission which was also throwing he same error, to sort it I forced the default of the field to be 0 and therefore never null.
Thanks for the help
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
190 | |
54 | |
42 | |
38 | |
33 |
User | Count |
---|---|
256 | |
78 | |
73 | |
71 | |
68 |