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 / UPDATE BY PATCH IS NOT...
Power Apps
Unanswered

UPDATE BY PATCH IS NOT WORKING WITH LOOKUP COLUMN, TEXT, NUMBER

(0) ShareShare
ReportReport
Posted on by

I got this code on my edit item to update a SharePoint list:

Patch(
 MySharePointList;
 LookUp(
 MySharePointList;
 ID = GalleryWithTheItems.Selected.ID
 );
 {
 LookUpColumn1: {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
 Id: MyvarIDFromTheGalleryWithTheItems.ID;
 
 Value: DropDownWithTheChoiceLookUpColumn1.Selected.Result;
 LookUpColumn2: {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
 Id: MyvarIDFromTheGalleryWithTheItems.ID;
 
 Value: DropDownWithTheChoiceLookUpColumn2.Selected.Value
 }
 ;ColumnWithText: TextInputUmaLinhaGerenteComercial.Text}
 }
)

 

On my "GalleryWithTheItems" I have this code:

 

Set(varMode;"Edit");;Set(MyvarIDFromTheGalleryWithTheItems;ThisItem);;Navigate(ScreenToEditItems)

 

On my dropdown I have this on Items:

Distinct( ListCollection;Title)

And the Value : 

Result


On my default: 

If(varMode="Edit";GalleryWithTheItems.Selected.LookUpColumn1.Value;"1")


I dont why powerapps dont update the item on SharePoint list.


Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    @Gorilla_8 ,

    Still using Lookup columns I see - please serious consider simply writing to Text fields - it is much easier and you do not need those columns unless you are using them directly in SharePoint in Data Sheet views. However in answer to your question, you need something like this

    Patch(
     MySharePointList;
     {ID:GalleryWithTheItems.Selected.ID};
     {
     LookUpColumn1: 
     {
     Value: DropDownWithTheChoiceLookUpColumn1.Selected.Result;
     Id: 
     LookUp(
     ListCollection;
     Title = DropDownWithTheChoiceLookUpColumn1.Selected.Result
     ).ID
     },
     LookUpColumn2: 
     {
     Value: DropDownWithTheChoiceLookUpColumn2.Selected.Value;
     Id: 
     LookUp(
     ListCollection;
     YourOtherField = DropDownWithTheChoiceLookUpColumn2.Selected.Value
     ).ID
     }
     )
    )

    You need to reference the field looked up in ListCollection in both cases to "get the ID back". Before coming back, please try to understand the concept of what I have posted otherwise you will continue to struggle with this column type if you continue using them (I have not used them for many years).

     

    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.

  • Gorilla_8 Profile Picture
    on at

    @WarrenBelz 

     

    Thank for the help again.

     

    I got this error: "...form have 'parlyclose' waited 'curlyclose' "

    I got a search, and I understand your code, but when I got apply on my side:

    "Id" doesn't exist, and show me to put "ID" instead, and after the "  Title = DropDownWithTheChoiceLookUpColumn1.Selected.Result ", I got those errors:

     

    Gorilla_8_0-1632673223999.png

     

    Gorilla_8_1-1632673259906.png

     

    Gorilla_8_2-1632673283671.png

     

    Gorilla_8_3-1632673344879.png

     

     

     

     

  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    @Gorilla_8 ,

    This is a Lookup column you are patching? If so Id has to exist. Also look at the code now (a slight mis-type before, but I thought you might pick this up). Can you please post (in formatted text) the actual code you are using.

  • Gorilla_8 Profile Picture
    on at

    @WarrenBelz 

     

    No problem, here:

    Patch(
     Temp_IntDeMercado_MercadoConsumo;
     {ID: GaleriaMercadoConsumo.Selected.ID};
     {
     Estado: 
     {
     Value: DropdownEstado.Selected.Result;
     Id: 
     LookUp(
     ListMCONS;
     Estado.Id = DropdownEstado.Selected.Result
     ).ID
     };
     Cidade: 
     {
     Value: DropdownCidade.Selected.Value;
     Id: 
     LookUp(
     ListMCONS;
     Cidade = DropdownCidade.Selected.Value
     ).ID
     }
     )
    )

     

    The column "estado" and "cidade" is a lookup column, I know he got a "Id", that's I dont get it..

     

    He says the "Patch" got invalid arguments

  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    @Gorilla_8 ,

    Why are you looking up the Id? You need to look up the field in ListMCONS that matches the drop-down, so if it is Estado, you just need

    Estado = DropdownEstado.Selected.Result

    You will continue to have issues with this column type unless you either stop using it (which I recommend) or take some time to understand how it works.

     

    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.

     

  • Gorilla_8 Profile Picture
    on at

    @WarrenBelz 

     

    I got this code, and it's getting no error, but not updating the list

     

    Patch(
     Temp_IntDeMercado_MercadoConsumo;
     {ID: GaleriaMercadoConsumo.Selected.ID};
     {
     Estado: {
     Value: DropdownEstado.Selected.Result;
     Id: LookUp(
     ListMCONS;
     Estado.Value = DropdownEstado.Selected.Result
     ).ID
     };
     Cidade: {
     Value: DropdownCidade.Selected.Município;
     Id: LookUp(
     ListMCONS;
     Cidade.Value = DropdownCidade.Selected.Município
     ).ID
     }
     }
    )

     

  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    @Gorilla_8 ,

    Do you understand what this code is trying to do? You need to lookup the "other" list that is being looked up in SharePoint (is this ListMONS?) for the field (which must be Text, so .Value cannot be correct) and simply get the ID of that item. I urge you again to consider not using this field type - you simply do not need to do it.

  • Gorilla_8 Profile Picture
    on at

    @WarrenBelz 

     

    Yeah, but if try with  result, didn't work 

  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    @Gorilla_8 ,

    If you are looking up the same list and that is being looked up in SharePoint in the Lookup field and get the ID of that item, the Patch back to the field should work. However why are you continuing to use Estado.Value = DropdownEstado.Selected.Result ? Are you not looking up a Text field here ?

     

  • Gorilla_8 Profile Picture
    on at

    The patch isn't work because, I check the SPO list and not getting update, but I just tried "Estado.Value", because powerapps gave me this option, but I don't understand why he is not updating.

    No, "Estado" is a LookUp field. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard