cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

Patch(TableName not working Patch([@TableName] does work: why?

I have created two new entities

DierLijsten

DierLijstItems

 

I have used patched succesfully in several instances but now suddenly

Patch(DierLijstItems;Defaults(DierLijstItems);{Omschrijving:"test"})


Does not work:

PA says the column Omschrijving does not exist.

If I type my code PA suggests the fields of the table DierLijsten in stead of DierLijstItems


This line does work:
Patch([@DierLijstItems];Defaults(DierLijstItems);{Omschrijving:"test"})

Anyone know why this is so? Do the names of the tables are too much alike? like some old DOS 8 character restriction?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Patch(TableName not working Patch([@TableName] does work: why?

What I suspect is happening here is that this statement is either inside a gallery or form. If that's correct, the issue is that TableName is also the name of a column or relationship on whatever the Items property refers to. In that case, TableName refers to that column (same as ThisItem.TableName), while [@TableName] refers to the data source. This is a well known point of confusion and we're looking into improving it.

View solution in original post

10 REPLIES 10
Highlighted
Responsive Resident
Responsive Resident

Re: Patch(TableName not working Patch([@TableName] does work: why?

Hi HansHeintz,

 

Once to to entity and check if the column name Omschrijving exists in the powerplatform. If not then please add if already exists once try to publish your customizations and check.

 

If that doesn't work then instead of display name you can use schemaname as well for that.

 

Please let me know if you have any further questiosn on this.

 

Mark answer as verified if that answered your question.

 

Regards,

Pavan Kumar garlapati

Highlighted
Resolver II
Resolver II

Re: Patch(TableName not working Patch([@TableName] does work: why?

I regret to do not understand your reply.

Check if column exist in the powerplatform.

What is powerplatform?

I have an entity with that field/column.

Otherwise the second example would not work either.

 

Highlighted
Responsive Resident
Responsive Resident

Re: Patch(TableName not working Patch([@TableName] does work: why?

Can you please add schemaname instead of display name and check it please?

 

 

Mark answer as verified it it answers your question.

 

Regards, Pavan Kumar Garlapati

Highlighted
Resolver II
Resolver II

Re: Patch(TableName not working Patch([@TableName] does work: why?

"powerapps schemaname"

does not yield any results in google featuring the term "schemaname"

Highlighted
Responsive Resident
Responsive Resident

Re: Patch(TableName not working Patch([@TableName] does work: why?

Hi,

 

Apologies for short reply. Let me elaborate here.

 

Navigate to https://make.powerapps.com/environments. open your environment.

 

Expand Data tab left side and you can see Entities. Expand entities as well to see the list of entities.

 

Select your entity and navigate to Fields tab.

 

Verify your field and in that apart from display name the second column name (also called Schema Name). Copy it and use it as follows.

 

Patch([@DierLijstItems];Defaults(DierLijstItems);{schemanamewhichyouhavecopied:"test"})

 

Mark answer as verified if it does answers your question.

 

Regards,

Pavan Kumar Garlapati

 

Highlighted
Resolver II
Resolver II

Re: Patch(TableName not working Patch([@TableName] does work: why?

As stated in my first post I have no problem getting it to work with [@..

I was just wondering why always I simply could use the regular table name and not now.

I just want to know what is going on.

One difference with these tables is that I gave a diffeent name to the table for the plural descrption.

DierLijst and DierLijsten

DierLijstItem and DierLijstItems

To be complete on my FP:

Defaults(DierLijst) also has to be changed to Defaults([@DierLijstItems])
The first did not gave any direct errors but did not work either.

Highlighted
Responsive Resident
Responsive Resident

Re: Patch(TableName not working Patch([@TableName] does work: why?

Please check if you have added that in datasource. Click on Insert tab and data sources and check if the entity is selected there. That may be possible reason. If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Regards, Pavan Kumar Garlapati
Highlighted
Resolver II
Resolver II

Re: Patch(TableName not working Patch([@TableName] does work: why?

It works. You are not reading my question.

 

At All

Highlighted
Power Apps
Power Apps

Re: Patch(TableName not working Patch([@TableName] does work: why?

What I suspect is happening here is that this statement is either inside a gallery or form. If that's correct, the issue is that TableName is also the name of a column or relationship on whatever the Items property refers to. In that case, TableName refers to that column (same as ThisItem.TableName), while [@TableName] refers to the data source. This is a well known point of confusion and we're looking into improving it.

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,202)