web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Simple disambiguation ...
Power Apps
Unanswered

Simple disambiguation question sql table fields in a concat,lookup

(0) ShareShare
ReportReport
Posted on by 711

Hi,

In code example underneath example a "dier" from sql table

'[dbo].[dier]'

has a "ras_id" and I want the name "naam" of the "ras" from the table

'[dbo].[ras]'

using a lookup on integer field "ras_id"
This goes wrong (same name every time). I try to use the disambiguation rules from te PA operators page but if I try things like

'[dbo].[dier]'[@ras_id] in stead of ras_id I get an error at the = operator and a delgation warning
I am clearly in need of some syntax education

 

 

;;UpdateContext(
 {
 ExportDiergegevens:
 Concat(
 Filter('[dbo].[dier]';TextInput16.Text in naam)
 ;Text(dier_id) 
 & ";" & Trim(Mid(naam;Len(TextInput16.Text)+1)) 
 & ";" & LookUp('[dbo].[ras]';ras_id=ras_id;naam)
 & Char(10) 
 
 ) 
 })

 

 

 

 

Categories:
  • HansHeintz Profile Picture
    711 on at

    I got it to work by putting both tables in collections (in this example the "ras" table is already cached into a collection, but still would like to know the right syntax with the sql tables

     

    Reset(TextInput17)
    ;;UpdateContext({ExportDiergegevens:""})
    ;;Reset(TextInput17)
    ;;ClearCollect(TargetDieren;Filter('[dbo].[dier]';TextInput16.Text in naam))
    ;;UpdateContext(
     {
     ExportDiergegevens:
     Concat(
     TargetDieren
     ;Text(dier_id) 
     & ";" & Trim(Mid(naam;Len(TextInput16.Text)+1)) 
     & ";" & LookUp(CachedRas;CachedRas[@ras_id]=TargetDieren[@ras_id];naam)
     & Char(10) 
     
     ) 
     })

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @HansHeintz 

    As a general rule, I let ID be the name of the primary key in every table and use that table name in the foreign key in other tables.  For example, If I have a Customer table and an Order table, the foreign key in the Order table is CustomerID.  Then there is no ambiguity if I want to reference the Customer in an Order as Lookup(Customer, ID=ThisItem.CustomerID, CustomerName).  Also since all primary keys are called ID, I don't have to remember it when I am doing a lookup or filter. 

  • HansHeintz Profile Picture
    711 on at

    Problem is that i am working with the sql database from another company and my app works alongside their desktop application. So their database structure is a given for me.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @HansHeintz 

    Another option is to run a RenameColumns() function to disambiguate the column.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard