cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vik
Regular Visitor

How does the "[@[@" notation work?

I'm seeing this in the autocomplete, it looks like the Excel Table notation format but I don't see any documentation on how it applies here.

1 ACCEPTED SOLUTION

Accepted Solutions
rgruian
Power Apps
Power Apps

PowerApps provides the [@ident] syntax for two kinds of identifier disambiguation.

 

[@global_name]

This is used for global identifier disambiguation. When a global name (such as slider1) collides with another name (for example the name of a column in a table, within an aggregate formula), one can use the [@name] to refer specifically to the global name, whereas the unqualified name refers to the inner (column) name:

 

    Filter(MyTable, [@slider1].Value = slider1.Value)

 

In the example above, [@slider1] refers to the global slider1 control, whereas slider1 refers to the hypothetical column name 'slider1' within MyTable.

 

name[@field]

This is used for row scope disambiguation. In some cases formulas may include nested aggregates that operate on tables with colliding names. For example some column 'CustomerID' that exists in both Customers and Orders. According to the PowerApps Language's scoping rules, the innermost row scope obscures the outer row scope. When access to such colliding field names is desired within the innermost scope, one can use this disambiguation syntax to refer to either the inner or the outer fields explicitly, as necessary. For example:

 

    Filter(Orders, Amount < LookUp(Customers, CustomerID = Orders[@CustomerID], TypicalAmount))

 

In the formula above, CustomerID refers to the field in the innermost row scope (i.e. a field in Customers), whereas Orders[@CustomerID] refers to the corresponding CustomerID field in the outermost row scope (i.e. a field in Orders).

 

I hope this helps.

 

Radu Gruian [MSFT] ** PowerApps Staff

View solution in original post

2 REPLIES 2
rgruian
Power Apps
Power Apps

PowerApps provides the [@ident] syntax for two kinds of identifier disambiguation.

 

[@global_name]

This is used for global identifier disambiguation. When a global name (such as slider1) collides with another name (for example the name of a column in a table, within an aggregate formula), one can use the [@name] to refer specifically to the global name, whereas the unqualified name refers to the inner (column) name:

 

    Filter(MyTable, [@slider1].Value = slider1.Value)

 

In the example above, [@slider1] refers to the global slider1 control, whereas slider1 refers to the hypothetical column name 'slider1' within MyTable.

 

name[@field]

This is used for row scope disambiguation. In some cases formulas may include nested aggregates that operate on tables with colliding names. For example some column 'CustomerID' that exists in both Customers and Orders. According to the PowerApps Language's scoping rules, the innermost row scope obscures the outer row scope. When access to such colliding field names is desired within the innermost scope, one can use this disambiguation syntax to refer to either the inner or the outer fields explicitly, as necessary. For example:

 

    Filter(Orders, Amount < LookUp(Customers, CustomerID = Orders[@CustomerID], TypicalAmount))

 

In the formula above, CustomerID refers to the field in the innermost row scope (i.e. a field in Customers), whereas Orders[@CustomerID] refers to the corresponding CustomerID field in the outermost row scope (i.e. a field in Orders).

 

I hope this helps.

 

Radu Gruian [MSFT] ** PowerApps Staff

View solution in original post

Resolved my doubts also. Thanks!

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 (15,928)