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 / Patch not functioning ...
Power Apps
Unanswered

Patch not functioning correctly

(0) ShareShare
ReportReport
Posted on by 5

I have two apps, both utilize a patch function.

 

App 1 patch function works perfectly. App 2, the op hours isn't working. In both apps, the respective hours column are 'single lines of texts'. 

- I've tried reformatting the patch to match app 1 exactly.

- Changing the hours column on app 2 to a number.

- Changing the function to collect

- Changing the patch function to Patch( SOURCE DATA, DEFAULTS(SOURCE DATE), Record: Update.....

 

At a loss and I've wasted a couple of hours on this

 

App 1

Patch('Dispensary Schedule Jack v1', {Status: "Completed"}, {Title: "Break-In"} , {Hours: Value(Caption2.Text)}, {'Dispense Date': Now()}, {Comments: DataCardValue103.Text});

APP 2

Patch(SOURCE DATA, {Order: "Break In", 'Delivery Date': Now(), 'Op Hours': Value(Caption2.Text), Comments: DataCardValue103.Text, Status: "Completed"}); 

 

 

Categories:
  • mmollet Profile Picture
    3,187 on at

    Have you changed any column names in the SP list you use for App 2? This can cause issues sometimes in Power Apps. For example a column named PersonName that is changed to FullName later can someone not work correctly due to the column name not actually changed but rather the label for the column changing. You can check this by going to: List Settings > Select the Column in question > check the URL bar at top for the true column name.

     

    Screenshot 2023-03-29 at 4.33.16 PM.png

     

    Also was wondering why one of your patch statement is in a different format than the other?

    Patch(ListName, {field 1}, {field 2}, {field 3});

    vs.

    Patch(ListName, {field1, field2, field3});

     

    Maybe this is causing issues? I am not sure if this can cause issues as I dont really know how that is working so forgive me if I'm being ignorant about that topic. 

  • jkinghan Profile Picture
    5 on at

    Yea, for app 2 the original column for Order was Title, so I must of changed that and I'd imagine this may be the issue.

     

    As for the format, both formats worked for app 1 so not too sure myself, but many thanks for the help : )

  • rswain Profile Picture
    173 on at
    It's hard to say exactly what's causing the issue without more information, but here are a few things you could try to troubleshoot:
    
    Check that the column names in the PATCH function for App 2 match the actual column names in the data source.
    
    Make sure that the data types of the columns in the data source match the data types in the PATCH function.
    
    Check that there are no required fields in the data source that are not being filled in by the PATCH function.
    
    Try simplifying the PATCH function in App 2 to see if that helps isolate the issue. For example, you could remove all the values except for Op Hours to see if that value is being correctly updated.
    
    Check if there are any other errors or warnings being reported in the app or in the data source that could be related to the PATCH function.
    
    Hopefully one of these suggestions helps you identify the issue and get your PATCH function working correctly in App 2.
  • WarrenBelz Profile Picture
    156,536 Most Valuable Professional on at

    Hi @jkinghan ,

    Changing data types in fields is not always a good idea, although you are using Patch here rather than SubmitForm where Data Cards get confused.

    To clarify, if you want a number, then make Hours a number and use Value(TextBox.Text) like you have been doing. I also assume here you are creating new records, so just for clarity, follow the Defaults() path

    Patch(
     SOURCE DATA, 
     Defaults(SOURCE DATA),
     {
     Order: "Break In", 
     'Delivery Date': Today(), 
     'Op Hours': Value(Caption2.Text), 
     Comments: DataCardValue103.Text, 
     Status: "Completed"
     }
    ); 
    

    I will also make the following assumptions (please advise if incorrect)

    • Order, Comments and Status are Single Lines of Text 
    • 'Delivery Date' is a Date/Time (Date only field)
    • 'OP Hours' is a Number field

    I am also going to take a wild guess here that Status is a Choice field, in which case you need

    Status: {Value: "Completed"}

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

     

     

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard