web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Saving number in SQL S...
Power Apps
Answered

Saving number in SQL Server

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have made a Canvas app that needs to maintain data in a table in SQL Server. I have bound the contents of a SQL view to a Gallery.

 

It looks like this:

jlundstocholm_0-1642759648445.png

When I click the green icon in the last line I would like to insert a row in a table with the typed-in values. 

 

My formula looks like this:

 

Set(Var_SelectedRecord, ThisItem);
Set(Var_AssignmentId, GUID(Var_SelectedRecord.AssignmentId));

Patch('Custom.AssignmentRates', Defaults('Custom.AssignmentRates'),
{AssignmentId: GUID(Var_SelectedRecord.AssignmentId)},
{HourlyRate: 125},
{Currency:txtCurrency.Text },
{Id: GUID()});

Refresh('Custom.vProjectOverview');

 

This works fine 🙂.

 

The reason the "HourlyRate" is set to 125 is that I cannot figure out how to use the actual value in input field (it is called txtRate). If I replace 125 with 

 

{HourlyRate: txtRate.Text},

 

I get this error:

jlundstocholm_1-1642759940952.png

If I try to cast it to e.g. a number, I get this error.

jlundstocholm_2-1642760088732.png

The question is ofc - how can I use the typed-in value from this input field in my formula?

 

Note: The "Format type" of the input field txtRate in question is "Number".

jlundstocholm_3-1642760153600.png

 

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Found it ... the solution was to use "Value()" instead.

    {HourlyRate: Value(txtRate.Text)},

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard