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 / Not able to patch a lo...
Power Apps
Unanswered

Not able to patch a lookup value

(1) ShareShare
ReportReport
Posted on by 29

Hi all,

 

I'm having problems with a form that patches several columns to a SharePoint list. The problem lies at all the lookup columns in that list. In the examples that I will give below, I'm only using one lookup but I get the same error with all of them. I also added a screenshot as attachment.

 

Error:
- Invalid argument type. Expecting a Record value, but of a different schema.

- Missing column. Your formula is missing a column 'Id' with a type of 'Number'.

- The function 'Patch' has some invalid arguments

 

The patch functions that I tried:

 

Patch(Workspaces, {Id:Blank()},{Title:"Test",Department:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id: Dropdown1.Selected.Id,Value: Dropdown1.Selected.Titel}})
Patch(Workspaces, {Id:Blank()},{Title:"Test",Department:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:LookUp('Department abbreviations',Id = Dropdown1.Selected.Id,Id),Value:LookUp('Department abbreviations',Id = Dropdown1.Selected.Id,Titel)}})

 

 

And almost every scenario to make sure there is no difference between Id < > ID and Title < > Titel (dutch for Title)

 

The weird thing is that I created this app on our dev environment (where it worked), used the export/import action to get it to our acceptance (where it worked) and used the export/import to get it to production (where it doesn't work). So I know that the Patch function at a certain point did work.

 

If we look at the back-end:

On our 3 environments (dev, acceptance, production), the back-end was created using a PowerShell script. So the columns that are created are exactly the same. Did notice that on our production environment the display names did not came through so I did that manually (don't know if that could have something to do with this problem).

I've tried creating a lookup column manually => Same issue

I wanted to make sure the export/import wasn't causing this so I created a new app with a simple button on it => Same issue

 

If you need more information/screenshots, always happy to provide them.

 

I really hope that I'm missing something obvious... 🙂

 

Thanks!

Untitled.png
Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @JanV ,

    Could you please share a bit more about your issue?

    Do you want to patch data into the LookUp field in your SP list based on the selected value in your Dropdown box?

    Further, could you please share a bit more about the formula typed within the Items proeprty of your Dropdown box?

     

    Based on the formula that you provided, I think there is something wrong with it. I have made a test on my side, please take a try to modify your formula as below:

    Patch(
    Workspaces,
    Defaults(Workspaces),
    {
    Title:"Test",
    Department: {
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id: LookUp('ReferencedSPList', ReferencedColumn = Dropdown1.Selected.Value, ID),
    Dropdown1.Selected.Value
    }
    }
    )

    Note: The Department is a LookUp column in your Workspaces SP list, which lookup values from ReferencedColumn in your ReferencedSPList.

    More details about saving data into LookUp column of SP list, please check and see if the response within the following threads would help in your scenario:

    https://powerusers.microsoft.com/t5/General-Discussion/Cascading-Drop-Down-Result-not-saving/m-p/239401

    https://powerusers.microsoft.com/t5/General-Discussion/Save-Filtered-Lookup-Value-in-List-Custom-Form/m-p/173236

    https://powerusers.microsoft.com/t5/General-Discussion/How-to-patch-a-SP-List-B-Lookup-column-of-SP-List-A-ID/m-p/166672

     

    Best regards,

  • JanV Profile Picture
    29 on at

    Thanks for the reply.

    Your formula does not work either. Getting the same errors.

    My ddlDepartment dropdown is getting its items from a datasource:

    'Department abbreviations'

     I already found a workaround by using a hidden form instead of the patch function: https://www.youtube.com/watch?v=YIoFyFQuC_c

    But I still want to know what went wrong with my patch function.

     

  • PDRinoG Profile Picture
    40 on at

    Hi,


    Was the default site language of your SharePoint set to Dutch?

     

     

  • OliverR-82 Profile Picture
    623 on at

    Hi @PDRinoG ,

    I'm sorry to bring up an "old" thread, but I wanted to ask if there is something special about this problem when your interface is in Dutch. I'm asking because I'm running into this problem again on an environment that is in Dutch. Code that I seem to remember working fine on English environments seems to not work here, and I have no idea why.

    So just wanted to ask if there is anything special I should try on a Dutch environment?

  • PDRinoG Profile Picture
    40 on at

    Hi @OliverR-82
    I have reported the same problem. The default site language of the live environment was in dutch, everything in the app worked in our dev environment (default language English) till it was imported into the live environment. It looks like this is a bug.

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-a-lookup-value-Problem-when-the-default-language-of-the/m-p/919803#M291642

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 839

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 412

Last 30 days Overall leaderboard