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 function: How to...
Power Apps
Answered

Patch function: How to patch only the columns stated in the patch function?

(0) ShareShare
ReportReport
Posted on by 518 Moderator

Hello,

ich have an canvas app.

Here i usr a patch function to update the columns changed be the user. But i only want to change the columns specified in the patch function:

If(CountRows(colKostenChange)>0,
ForAll(colKostenChange,
Patch(Kosten,
LookUp(Kosten,Kosten=kostenidGUID,
{
Datum:Datum,
Betrag1:Betrag1,
KostenKategorie:slmr_KostenKategorie_Kat,
Betrag2:Betrag2,
Betrag3:Betrag3,
Beschreibung:Beschreibung
}

)
);
Notify(
"Succes",
NotificationType.Success)
)

This works fine. But all columns in the table that i do not mention here are set to null.

How can i only change the columns i want to?

Also i have set some columns to business required, but the user can still enter records where the colums have no values.

Is business required not the same as "not null" in a "normal" database? 

Categories:
  • Verified answer
    SLMR Profile Picture
    518 Moderator on at

    My mistake.

    The patch function inserted a new row, insted of updating the selected one.

    So i have an error somewhere else.

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,975 Super User 2026 Season 2 on at

    Hi,

     

    I have a favor, pretty please please use the </> code snippet. It's impossible to read that. 

     

    If you are Patching an existing record, there is nothing in a Patch that would make the other columns NULL. There must be a plugin, workflow, business rules or flow or some other code doing it.

     

    Patches do not blank out columns. They only touch the columns you specify. There is something else going on that hasn't been found.

     

    But I recommend doing this with Monitor and see it you find anything else.

     

    Step 1. Close your App (stop it running)
    Step 2. Click the Stethoscope in the Top Right
    Step 3. On the bottom click Open Monitor
    Step 4. Once Monitor is running go back and run your app
    Step 5. Cause your issue to happen
    Step 6. Close the app
    Step 7. Go to the Monitor and Filter (top right) based on Error, or key word(like Patch). Find the error/keyword line and look at the information Monitor has for why it failed/details about it

     


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • SLMR Profile Picture
    518 Moderator on at

    Thanks for the adivice with the monitor.

    Anyway i found the problem, there was some mess with the brackets, so i did not really update the row i wanted, but inserted a new one

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

#2
WarrenBelz Profile Picture

WarrenBelz 191 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 167

Last 30 days Overall leaderboard