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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching one item, del...
Power Apps
Answered

Patching one item, deletes another

(1) ShareShare
ReportReport
Posted on by 93
Hi there,
 
I have a simple form where I have 4 text fields (a date, a dropbox People item, a multiline comments textbox and a label that contains initials.)
 
I use a button to 'add initials' to the label (4th item) with a Patch command.
It correctly patches the record - but at the same time, erases the values in one of my text boxes.
 
The other two items are fine - left untouched - just the "Comments" data is deleted.

Any thoughts?

Amber
 
I have the same question (0)
  • Sam_Fawzi Profile Picture
    750 Super User 2025 Season 2 on at
     
    To gain a clearer understanding of the situation and offer effective assistance, could you please share the Patch code you are using, along with the default or Text values of your data fields? Additionally, are these fields part of a form, or are they standalone elements? This information will help me identify any potential issues or errors in the implementation.
     
     
  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at
     
    May i know what is the default value available in Comments field?
     
    Please mark as answer if my suggestion helps.
    Subscribe here for More Useful videos : https://www.youtube.com/@rampprakash3991
  • AH-22100006-0 Profile Picture
    93 on at
    Thanks Sam,
     
    My Patch code looks like this:
     
     
    Set(varExitBtnVisible,true);
     
    If(IsBlank(labInitials.Text),
        UpdateContext({varInitials: Concat(Split(User().FullName, " "), Left(Value, 1))}),
        UpdateContext({varInitials: labInitials.Text & ", " & Concat(Split(User().FullName, " "), Left(Value, 1))}))
        ;
     
    Patch(
        'MyList',
        LookUp('MyList',ID = galNotes.Selected.ID),
        {
            InitialsRead: varInitials
            }
    )
     
     
    The text value of my "Comments" field (the one that is being overwritten/blanked out) is:
     
    galNotes.Selected.Comments
     
    (it pulls from a gallery on the container.)
     
     
    These items are sitting in a container, on a 'screen'.
    I've pasted a screen shot, for a visual.
     
    Thanks in advance :)
     
  • Suggested answer
    Sam_Fawzi Profile Picture
    750 Super User 2025 Season 2 on at
    Hey @
     
    Even though you're using galNotes.Selected to populate the gallery and fields like Comments, if the galNotes.Selected.Comments value is not part of the gallery’s fields or has not been fetched explicitly, it may be null at the time of patching — and Patch() will interpret that as "clear this field".
    try patching all the fields and see if that will make any difference
     
    Patch(
        'MyList',
        LookUp('MyList', ID = galNotes.Selected.ID),
        {
            InitialsRead: varInitials,
            Comments: galNotes.Selected.Comments,
            People: galNotes.Selected.People,
            Date: galNotes.Selected.Date
        }
    )
     
    Let me know if you have any question
     
    Cheers
  • AH-22100006-0 Profile Picture
    93 on at
    Thanks Sam!
     
    So I added the code you suggested - same result.
    What's odd is that the date (EntryDate) and 'Created By' fields both stay correctly populated - just the Comments text gets erased when the 'Add Initials' button is pressed...
     
    My new code:
     
    Patch(
        'MyList',
        LookUp('MyList',ID = galNotes.Selected.ID),
        {
            InitialsRead: varInitials,
            Comments: galNotes.Selected.Comments,
            'Created By': galNotes.Selected.'Created By',
            EntryDate: galNotes.Selected.EntryDate
            }
    )
  • Verified answer
    Sam_Fawzi Profile Picture
    750 Super User 2025 Season 2 on at
    Hi @
     
    I have a couple of questions regarding the Comments field that might help us troubleshoot the issue you're experiencing:
    • Could you please confirm the type of the Comments field in your data source? Is it a single-line text, multi-line text, or another type?
    • Is the "Append Changes" feature enabled for the Comments field? This setting can sometimes affect how data is stored and displayed.
    • Would you be able to check the data source directly and examine the current values in the Comments field? 
  • AH-22100006-0 Profile Picture
    93 on at
    Thanks @Sam_Fawzi!
     
    • Could you please confirm the type of the Comments field in your data source? Is it a single-line text, multi-line text, or another type?
                   
                    The column type is 'Multiple lines of text' (Number of Lines for editing = 6)
     
    • Is the "Append Changes" feature enabled for the Comments field? This setting can sometimes affect how data is stored and displayed.
     
                   Append Changes to Existing Text - YES
     
    • Would you be able to check the data source directly and examine the current values in the Comments field? 
     
                     I think this shows the issue - the comments aren't blank. Maybe they aren't showing up because there are multiple entries?  For example, one record has 6 comments - I can see them all in the list, when I click 'View Entries'. I think I'd like to change this, so there is only ever one comment - a user can enter multiple records if they want multiple comments. I assume I turn off append?
     
    Amber
     
     
  • Verified answer
    Sam_Fawzi Profile Picture
    750 Super User 2025 Season 2 on at
     
    If you don't require the "Append Changes to Existing Text" feature, you can disable it, which will resolve the display issue. Otherwise, there are several workarounds to display comments in PowerApps. Let me know if you'd like me to share some references with you!
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard