cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Rkaur
Level: Powered On

Accessing a gallery item uses disambiguate(@) operator for reference and prints last record multiple times

Hi,

I have a working app logic where im accesing all the gallery items and patching onto my datasource. there is a text box and a checkbox in my galley. Current environment was a D365 CRM. However when i moved my app onto a standalone CDS environment here the same Patch function is broken and it is only referencing the last selected item in the gallery when looping. and prints that record n number of times ( n is the gallery count)

Now, the only change,between the two functions is in CDS dbase, in order to access my gallery item now, it requires a disambiguate operator. Without it, it dosnt refrence teh gallery item.

 

in my original app, i could access the gallery item without the @ opeartor.

Can someone please guide, what is teh issue here ? is it because of the @ operator coz its the same function working fine in otehr env but not in CDS

@ operator.PNG

3 REPLIES 3
Community Support Team
Community Support Team

Re: Accessing a gallery item uses disambiguate(@) operator for reference and prints last record multiple times

Hi @Rkaur ,

 

In PowerApps, I haven't heard of a CDS environment. Can you please clarify this? Did you mean that you have moved the app from one environment to another following the link below?

https://docs.microsoft.com/en-us/power-platform/admin/environment-and-tenant-migration

 

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).

 

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Rkaur
Level: Powered On

Re: Accessing a gallery item uses disambiguate(@) operator for reference and prints last record multiple times

Hi Mona,

 

What i meant was different databases on the same tenant.

By default i had a customer engagemnet database on a tenant so i started building my app onto the same env/database. This app of mine was in the  background referring to D365 CRM database . 

Next, on the same tenant i create another enviornment for a CDS database. so i custom created all my solution entities into the  OOB COmmon Data Services Default solution. 

 

Thats the only environment difference i was referring to.

App remains teh same, logic is same. naming conventions and datasources i corrected and mapped.

 

With all this above in place, my PATCH function above staretd behaving differently as in it was jus creating either the first row in gallery n number of times (when nothing is selected) or the last selected item n number of items. 

Now in my function "@" was extra which my original app didnt use.( screenshot above) 

so im not sure the same function is working fine in one environment but in other it isnt ( same tenant)

 

Can you guide why is this@ operator needed to reference my gallery item when previosuly it was just being referenced directly?

Re: Accessing a gallery item uses disambiguate(@) operator for reference and prints last record multiple times

I recently experienced an issue where my actual TableName was the same as a ColumnName on a different. Despite my best efforts I couldn't get the disambiguate(@) operator working with table name. Having spent too much time already trying to put the disambiguate(@) operator in different place (table name, column name, both etc.).

 

I eventually decided to load the table into a local collection where I could at least implicitly give the local collection an unmbiguatious / unique name whereupon I has able to work with the collection for the purposes on my apps requirements. Obviously this wouldn't suffice as-is should you need to update items in the list. For your purposes your could alternatively porssibly look at the RenameColumns function  as I would expect that to equal work and likely resolve you problem.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 164 members 4,638 guests
Recent signins:
Please welcome our newest community members: