Skip to main content

Notifications

Community site session details

Community site session details

Session Id : whRqgHlrcd7AAkbTEntbNk
Power Apps - Building Power Apps
Unanswered

Patch error, Name isnt Valid. ThisItem is not recognized.

Like (0) ShareShare
ReportReport
Posted on 11 Sep 2023 17:29:21 by 909 Super User 2024 Season 1

Hi,

 

I am trying to patch to update a value in my form. 

When i use - Patch('Data Source', ThisItem, {'impact comment':TextInput1.Text}) 

 

my formula gets the error "Name isnt Valid. ThisItem is not recognized."

 

why is this? I want to update the current record Im in.

 

Thanks.

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on 11 Sep 2023 at 18:47:40
    Re: Patch error, Name isnt Valid. ThisItem is not recognized.

    IF all the changes are saved on sharepoint side (verify it) and the controls are not updating to those values you probably need to check the default of every single control in the form because if it is resetting it should be resettign to whatever their defaults are (and if its not their values in sharepoint then the form is probably set up wrong)

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on 11 Sep 2023 at 18:46:00
    Re: Patch error, Name isnt Valid. ThisItem is not recognized.

    the changes are saved though.  and then it just resets the fields.

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on 11 Sep 2023 at 18:43:17
    Re: Patch error, Name isnt Valid. ThisItem is not recognized.

    because if you dont save any changes you made (via the patch) when you patch the item the item is now new and thus reloads your form to the new version of the record and a new form resets all the controls in the form

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on 11 Sep 2023 at 18:41:09
    Re: Patch error, Name isnt Valid. ThisItem is not recognized.

    @TheRobRush  Datacard dropdown default is blank... not sure how that happened as I believe it should be Parent.Default right?

     

    the datacard default is "thisItem.'Final Conclusion" 

     

     

    Anyway so I added Parent.Default to the dropdown datacardvalue and retried -

     

    Patch('Data Source', {ID: gblRecordID, 'impact comment':TextInput1.Text});. 

     

    Still refreshing datacardvalue to no choice. Realizing its refrshing other changes i make to.. wonder why..

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on 11 Sep 2023 at 18:22:44
    Re: Patch error, Name isnt Valid. ThisItem is not recognized.

    what is the dropdown based on default wise? If it is not based on the underlying data and is just an added control to the form that the user manipulates I'd say odds are when you patch the data, it updates the data in your app too, which resets the form because the item being displayed in the form has now changed. you would need to do something like when form loads set a variable for example Set(isNewVar, false) and make dropdown default check to see if isNewVar=false and if it does make your default whatever you want it ot be for a fresh form, and onchange of that dropdown if Dropdown.Selected.Value = "New" then Set(isNewVar, true) this way that dropdown will continue to show New until you "Load a new item" and thus trigger the Set(isNewVar, false)  again

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on 11 Sep 2023 at 18:09:22
    Re: Patch error, Name isnt Valid. ThisItem is not recognized.

    @TheRobRush  what seems to work is this - I set gblRecordID before getting to this screen.

     

    Patch('Data Source', {ID: gblRecordID, 'impact comment':TextInput1.Text}) ;

     

    But now when i submit - it resets a field in my editform.

     

    This is DataCardVlaue40... And it is a dropdown.. When the dropdown is set to "New" then the popup comes up with the submit button, which contains the patch... Its like when I patch it resets DataCardValue40.

     

     

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on 11 Sep 2023 at 17:59:28
    Re: Patch error, Name isnt Valid. ThisItem is not recognized.

    Any control you place into a datacard on a form should have access to Parent.Default. You may need to share pictures of your form, its source & item properties, the button and its datacard etc so we can see what you have got wrong there

  • wonka1234 Profile Picture
    909 Super User 2024 Season 1 on 11 Sep 2023 at 17:52:35
    Re: Patch error, Name isnt Valid. ThisItem is not recognized.

    @TheRobRush  thanks but whats weird is I am getting another error 

    Name isnt Valid. Default isnt recognized.
  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on 11 Sep 2023 at 17:49:34
    Re: Patch error, Name isnt Valid. ThisItem is not recognized.

    *updated above with an example that is working on my side

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on 11 Sep 2023 at 17:46:46
    Re: Patch error, Name isnt Valid. ThisItem is not recognized.

    Sorry, that code would be for a gallery, when it's on a form you need to make it

     

     

    Patch('Data Source', {ID: Value(Parent.Default), 'impact comment':TextInput1.Text}) 
    
    
    example
    
    Patch(ParkingRequests, {ID: Value(Parent.Default),AssignedBarcode:12345})

     

     

    AND have the button doing this patch in a datacard set up for the items id.

     

    TheRobRush_0-1694454612495.png

     

    Or make parent.id First(datasource).ID or whatever the filter is to select this specific item (in the Item Property of the form) followed by .ID

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

Overall leaderboard
Loading started