cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ingovals
Helper I
Helper I

Differentiate between Columns and Tables with same name

I'm having issues with Column names and Table names. My formulas are assuming I'm using one when I want to use the other.

Is there a quick fix for this.

 

This is mostly relevant for Lookup tables, since on the parent side the dot notation allows for a "reverse lookup" property that has the same name as the table.

 

To give and example of this issue. I'm trying to Create a new item of Parent, and then some children.

 

Patch('Parent Table', Defaults('Parent Table');
Patch('Child Table', Defaults('Child Table);

Here I get the error A one to many ... is being reference in this functions record scope. I'm assuming this is because the functions assumes I'm meaning 'Child Table' the property of 'Parent Table' not the table itself.

 

1 ACCEPTED SOLUTION

Accepted Solutions
iAm_ManCat
Super User
Super User

You can use the disambiguation operator to clarify which you are referring to:

Operators and Identifiers in Power Apps - Power Apps | Microsoft Docs

 

Like this:

Patch([@Parent Table], Defaults([@Parent Table], { RECORDS_GO_HERE });
Patch([@Child Table],  Defaults([@Child Table],  { RECORDS_GO_HERE });

 

And lets say you have a column in your child table called parent table, you would refer to it like this:

'Child Table'[@'Parent Table']

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

1 REPLY 1
iAm_ManCat
Super User
Super User

You can use the disambiguation operator to clarify which you are referring to:

Operators and Identifiers in Power Apps - Power Apps | Microsoft Docs

 

Like this:

Patch([@Parent Table], Defaults([@Parent Table], { RECORDS_GO_HERE });
Patch([@Child Table],  Defaults([@Child Table],  { RECORDS_GO_HERE });

 

And lets say you have a column in your child table called parent table, you would refer to it like this:

'Child Table'[@'Parent Table']

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (7,081)