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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Patch a new reconrd to a SharePoint List with a Field from A Text Input and a Lookup Field

(0) ShareShare
ReportReport
Posted on by 42

Hello everybody. 

Patch(
 testProjekt_Lokal; 
 Defaults(testProjekt_Lokal);
 { 
 Projekt_Name: TextInput1.Text;
 KundeID: 
 LookUp(
 testKunde_Lokal; Kunde_ID = ComboBox2.Selected.Kunde_ID)
 }
)

 

 

Trying to patch with a button the text content from a Input Field (TextInput1.Text) and the selected value in a combo box (ComboBox2.Selected.Kunde_ID). Those values are called in the SharePoint List respectively "Projekt_Name:" and "KundeID". KundeID is a LookUp Field. 

 

Now I have no clue why this is not working. Three error messages so far:

RPowerAutomated_0-1700488487961.png

 

That means: 

1) Invalid argument type. Expecting a record value, but of a different schema.

 

??? testProjekt_Lokal has only optional values and I am patching those values:

RPowerAutomated_1-1700488681010.png

It makes no sense at all. 

 

2) Error message regarding missing column

3) Invalid arguments for PATCH. 

 

 

I have no clue, can somebody help?

I have the same question (0)
  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at
    Re: Patch a new reconrd to a SharePoint List with a Field from A Text Input and a Lookup Field

    Hi,

     

    This LookUp( testKunde_Lokal; Kunde_ID = ComboBox2.Selected.Kunde_ID) looks good but power apps doesn´t like it.

     

    Usually, putting things in a label helps in getting additional hints on what may be wrong.

  • dukatz Profile Picture
    165 on at
    Re: Patch a new reconrd to a SharePoint List with a Field from A Text Input and a Lookup Field

    To Patch al LookUp field you need to pacth the ID and the value of the LookUp. You're only patching the ID once. here is an example PATCH A SharePoint LookUp Column In Power Apps - Matthew Devaney

     

  • RPowerAutomated Profile Picture
    42 on at
    Re: Patch a new reconrd to a SharePoint List with a Field from A Text Input and a Lookup Field

    The Example has to have two values, one for ID and nome for the Value. But I Only need the ID from "Kunden" in my Projekt list. 

    The example dosent help at all, since the id is hardcoded there (2) but I want to retrieve it from a combobox selection. 

  • RPowerAutomated Profile Picture
    42 on at
    Re: Patch a new reconrd to a SharePoint List with a Field from A Text Input and a Lookup Field

    If I add a last Argument to my lookup it will work and give the selected ID back: 

    RPowerAutomated_0-1700490236211.png

     

    Still the Patch Function wont work. 

  • Verified answer
    RPowerAutomated Profile Picture
    42 on at
    Re: Patch a new reconrd to a SharePoint List with a Field from A Text Input and a Lookup Field

    This worked for me: 

     

    Patch(
     testProjekt_Lokal; 
     Defaults(testProjekt_Lokal);
     { 
     Projekt_Name: TextInput1.Text;
     KundeID: {
     Id: ComboBox2.Selected.Kunde_ID;
     Value: LookUp(testKunde_Lokal; Kunde_ID = ComboBox2.Selected.Kunde_ID; Kunde_ID)
     }
     }
    )

     

    Basically split the Lookup Field in the Child Table in Id and Value. They are both necessary. 
    Thanks @dukatz for the Link.

  • dukatz Profile Picture
    165 on at
    Re: Patch a new reconrd to a SharePoint List with a Field from A Text Input and a Lookup Field

    ID is internal for Power Apps to know which field your referencing, Value is the Value that is shown inside the List (if I'm not mistaking). Just use your ID for both Value and 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

Coming soon: forum hierarchy changes

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 819 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 308 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 222 Super User 2025 Season 2

Last 30 days Overall leaderboard