Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Patching one item, deletes another

(1) ShareShare
ReportReport
Posted on by 30
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
 
  • Verified answer
    Sam_Fawzi Profile Picture
    445 Super User 2025 Season 1 on at
    Patching one item, deletes another
     
    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!
     
  • AH-22100006-0 Profile Picture
    30 on at
    Patching one item, deletes another
    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
    445 Super User 2025 Season 1 on at
    Patching one item, deletes another
    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
    30 on at
    Patching one item, deletes another
    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
            }
    )
  • Suggested answer
    Sam_Fawzi Profile Picture
    445 Super User 2025 Season 1 on at
    Patching one item, deletes another
    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
    30 on at
    Patching one item, deletes another
    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 :)
     
  • Ram Prakash Profile Picture
    5,274 Super User 2025 Season 1 on at
    Patching one item, deletes another
     
    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
  • Sam_Fawzi Profile Picture
    445 Super User 2025 Season 1 on at
    Patching one item, deletes another
     
    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.
     
     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 770 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 494

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 399