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 / It should be simple bu...
Power Apps
Unanswered

It should be simple but.... Patch-Funktion

(0) ShareShare
ReportReport
Posted on by 12

I created two SharePoint lists to connect them using a button in Power App.

The aim should be to connect the lists with each other using a button.

What happened until now:

 

Gallery1 = SharepointList "Group" with just thre sample Items: Red, Green, Blue as Title, the SharepointID as ID Coplumn and a Column "Partner" as Lookup for the List EDV/ID


Gallery2 = SharepointList "EDV" Just three smple Items like Laptop, Monitor and keyboard as Title and the Sharepoint List ID.

 

When I edit an item in the "Group" list, I can select an item from the "EDV" list in "Partner" column. So far that looks right to me.

Now I have created a new, empty PowerApp “Test” and only included the catalogs of the lists here. On the left the catalog for the Group (Gallery1) and on the right the catalog for EDV (Gallery2). I used the Sharepoint connector for both.

Then I added a button to write the ID from the EDV list into the "Partner" column of the "Group" list. The selected ITEMs of the galleries should be taken into account.

I used this code:

 

 

Patch(
 Gruppen,
 {ID: Gallery1.Selected.ID},
 {Partner: Gallery2.Selected.ID}
);

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

 

 


But this button doesn't work and is directly marked with a red cross.

Error Message:


Bildschirmfoto 2023-12-11 um 16.46.23.png

I have absolutely no idea why!

Could it be due to the connection to the "Group" list in the patch function? The lists are assigned to mycompany.sharepoint.com

Anyone have an idea?

 

Categories:
I have the same question (0)
  • Sickle-Cell Profile Picture
    600 Super User 2024 Season 1 on at

    Hi @cAhler,

     

    Your formatting is wrong, try this:

     

     

    Patch(
     Gruppen,
     Defaults(Gruppen),
     {ID: Gallery1.Selected.ID,
     Partner: Gallery2.Selected.ID}
    );
    
    Notify("Success!", NotificationType.Success);

     

  • cAhler Profile Picture
    12 on at

    Thanks, but i still have errors on the Function OnSelect.

    Look at the Screenshots please:

    Bildschirmfoto 2023-12-11 um 18.51.11.png

    Error 1:

    Bildschirmfoto 2023-12-11 um 18.50.43.png

    Error 2:

    Bildschirmfoto 2023-12-11 um 18.50.53.png

    Error 3:

    Bildschirmfoto 2023-12-11 um 18.51.03.png

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @cAhler,

    The LookUp column expects a format like below:

    {
    Id:ID//ID from EDV list
    Value:Value
    }

    So, please modify as below:

    Patch(
     Gruppen,
     {ID: Gallery1.Selected.ID},
     {Partner: {Id:Gallery2.Selected.ID
     Value:Gallery2.Selected.ID}
     }
    );
    
    Notify("Success!", NotificationType.Success);

     

  • cAhler Profile Picture
    12 on at

    Here is my solutions for this, for people with the same Problem. 😉

     Patch(Kredite;{ID:gal_Kunden.Selected.ID;Partner:{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";Id: gal_FeWo.Selected.ID;Value: gal_FeWo.Selected.Name}});;



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 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard