cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HansHeintz
Helper V
Helper V

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

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
PavanKumar
Responsive Resident
Responsive Resident

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

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.

 

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

"powerapps schemaname"

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

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

 

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.

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

It works. You are not reading my question.

 

At All

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (63,711)