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 / Cannot Patch Float or ...
Power Apps
Answered

Cannot Patch Float or Number

(0) ShareShare
ReportReport
Posted on by 98

Hello everyone,

 

I'm having trouble patching a integer or float value into a SQL table. The field in question is in red and underlined in the following formula:

 

UpdateContext({DisableVar:true}); Patch('[dbo].[volunteer_sign_in]', Defaults('[dbo].[volunteer_sign_in]'), {volunteer_id: ActiveVolunteers.Selected.volunteer_id, last_name: ActiveVolunteers.Selected.last_name, first_name: ActiveVolunteers.Selected.first_name, initials: ActiveVolunteers.Selected.initials, date: SignInDate.SelectedDate, hours: SignInHours}); UpdateContext({ResetVar: true}); UpdateContext({ResetVar:false}); UpdateContext({DisableVar:false}); Navigate(StartScreen, ScreenTransition.None)

 

When I remove this field from the Patch function, a record is created; however, when I include the Hours field, I receive an unknown error message. I've changed the data type on the table from float to integer, and the control only accepts number values. I'm unsure where the issue lies. Any help is appreciated.

Categories:
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I think the problem might be that SignInHours are treated as a sting while the database requires a number value. 

    Try wrapping it in Value() it changes string into an number value

     

    So your function would be something like this:

    UpdateContext({DisableVar:true});
    Patch(
     '[dbo].[volunteer_sign_in]', 
     Defaults('[dbo].[volunteer_sign_in]'),
     {
     volunteer_id: ActiveVolunteers.Selected.volunteer_id,
     last_name: ActiveVolunteers.Selected.last_name,
     first_name: ActiveVolunteers.Selected.first_name, 
     initials: ActiveVolunteers.Selected.initials, 
     date: SignInDate.SelectedDate, 
     hours: Value(SignInHours)
     }
    ); 
    UpdateContext({ResetVar: true}); 
    UpdateContext({ResetVar:false}); 
    UpdateContext({DisableVar:false}); 
    Navigate(StartScreen, ScreenTransition.None)

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard