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

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

AddColumns with LookUps only brings in Key column from Dataverse

(0) ShareShare
ReportReport
Posted on by 6

I'm trying to get all necessary data from Dataverse in one query in my Power App

The query is as follows

 

 

fxGetMedicalInsuranceRecordFromDataVerse = ShowColumns(
 AddColumns(
 'Medical Insurance Details' As Details,
 Record,
 LookUp(
 ShowColumns(
 AddColumns(
 'Medical Insurance Records' As Record,
 PlanCode,
 Record.'Medical Insurance Record Plan Code',
 Grade,
 Record.'Medical Insurance Record Grade'
 ),
 'Medical Insurance Record Declaration Accepted',
 'Medical Insurance Record Employee Number',
 'Medical Insurance Record Enrolment Date',
 'Medical Insurance Record Membership Number',
 'Medical Insurance Record MHD',
 PlanCode,
 Grade
 ),
 wd_name = Details.'Medical Insurance Details Employee Number'
 ),
 Dependants,
 Filter(
 ShowColumns(
 AddColumns(
 'Medical Insurance Dependants' As Dependants,
 Relationship,
 Dependants.'Medical Insurance Dependant Relationship'
 ),
 'Medical Insurance Dependant Date Of Birth',
 'Medical Insurance Dependant Enrolment Date',
 'Medical Insurance Dependant Forename',
 'Medical Insurance Dependant Gender',
 'Medical Insurance Dependant MHD',
 'Medical Insurance Dependant Surname',
 'Medical Insurance Employee Number',
 'Medical Insurance Dependant Full Name',
 Relationship
 ),
 wd_name = Details.'Medical Insurance Details Employee Number'
 )
 ),
 'Medical Insurance Details Address Line 1',
 'Medical Insurance Details Address Line 2',
 'Medical Insurance Details Address Line 3',
 'Medical Insurance Details City',
 'Medical Insurance Details Cost Centre',
 'Medical Insurance Details Date Of Birth',
 'Medical Insurance Details Email',
 'Medical Insurance Details Employee Number',
 'Medical Insurance Details Forename',
 'Medical Insurance Details Full Name',
 'Medical Insurance Details Gender',
 'Medical Insurance Details Home Phone',
 'Medical Insurance Details Id',
 'Medical Insurance Details Mobile Phone',
 'Medical Insurance Details Postcode',
 'Medical Insurance Details Surname',
 'Medical Insurance Details Title',
 'Medical Insurance Details Town',
 Dependants,
 Record
);

 

 

I've tried without ShowColumns, I've tried with LookUps for each relationship and only for some with each approach yielding the same results.

 

I'm using the function as follows:

 

With(
 {
 currentUserMedicalInsuranceRecord: LookUp(
 fxGetMedicalInsuranceRecordFromDataVerse,
 wd_medicalinsurancedetailsemail = User().Email
 )
 },
 UpdateContext({locCurrentUserMedicalInsuranceRecord: currentUserMedicalInsuranceRecord});
);

 

What ends up being populated in the context variable is the details populated with all selected columns loaded, the Record then contains it's relationship columns but only has it's Key column loaded 0kpsR3SC

The same for the dependants and their relationship 3K0zIqlD

 

I've tried without ShowColumns and with, I've tried using LookUps for each relationship and I've tried adding the relationship as a separate column with no luck. I've tried setting it in a Global Variable rather than a context variable as well.

 

What am I missing? I've had success with this approach when querying SharePoint

I have the same question (0)
  • a1dancole Profile Picture
    6 on at
    Re: AddColumns with LookUps only brings in Key column from Dataverse

    Sorry to bump this up but I'm really getting nowhere with this.

     

    I've raised this with Microsoft support and was able to reproduce this with a very simple two table and 1 additional column solution and it was exactly the same problem, they also went away and reproduced it with their own app. 

     

    The only valid solution that has been come up with by their support has been to query every single column which does result in data coming back, but that's not reasonable in our application of this, nor does it seem reasonable for any real-world application.

     

    They finally have advised to raise it with a partner as it's a development issue, not a bug. So I'm really at a loss and would appreciate any assistance on this.

     

    This approach works fine with SharePoint Lists but not Dataverse which makes me believe it's a limitation of the Dataverse connector.

     

  • mmbr1606 Profile Picture
    14,353 Super User 2025 Season 2 on at
    Re: AddColumns with LookUps only brings in Key column from Dataverse

    hey @a1dancole 

     

    can you try this:

    ClearCollect(
     colMedicalInsuranceDetails,
     ShowColumns(
     AddColumns(
     'Medical Insurance Details',
     "Record", 
     LookUp(
     'Medical Insurance Records',
     'Medical Insurance Records'.'Employee Number' = 'Medical Insurance Details'.'Employee Number'
     ),
     "Dependants", 
     Filter(
     'Medical Insurance Dependants',
     'Medical Insurance Dependants'.'Employee Number' = 'Medical Insurance Details'.'Employee Number'
     )
     ),
     'Address Line 1',
     'Address Line 2',
     'Address Line 3',
     'City',
     'Cost Centre',
     'Date Of Birth',
     'Email',
     'Employee Number',
     'Forename',
     'Full Name',
     'Gender',
     'Home Phone',
     'Id',
     'Mobile Phone',
     'Postcode',
     'Surname',
     'Title',
     'Town',
     "Dependants",
     "Record"
     )
    );
    
    
    With(
     {
     currentUserMedicalInsuranceRecord: LookUp(
     colMedicalInsuranceDetails,
     Email = User().Email
     )
     },
     UpdateContext({locCurrentUserMedicalInsuranceRecord: currentUserMedicalInsuranceRecord})
    );
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • a1dancole Profile Picture
    6 on at
    Re: AddColumns with LookUps only brings in Key column from Dataverse

    Thank you @mmbr1606  for the response!

     

    I have just tried this and unfortunately it's resulted in the same thing, in both the context variable and the collection

     

    The collection:

    a1dancole_0-1716293782127.png

     

    The context variable:

    a1dancole_1-1716293841692.png

     

    Both of these screenshots are what's 'inside' the LookUp to the "Record" AddColumn, but other columns look identical with the Primary Key and Primary Name Columns being the only columns containing values. 

  • dhhenrique Profile Picture
    on at
    Re: AddColumns with LookUps only brings in Key column from Dataverse

    I've used the code below for a different scenario but maybe it could attend your needs :

     

    LookUp(
     Products, 
     COD=Item.COD,
     {
     Prod: ProductName, 
     Desc: ProductDescription,
     Pack: PackageSize, 
     Un: Unit
     }
    )
     
    In this case ProductName, ProductDescription, PackageSize and Unit are the names of the columns in the Products table.
  • a1dancole Profile Picture
    6 on at
    Re: AddColumns with LookUps only brings in Key column from Dataverse

    Thank you for your suggestion. I have tried this and get the following results 😣

     

    I updated the formula to (partial sample but the formula has changed since originally posting this after trying various solutions suggested by Microsoft and this forum):

     LookUp(
     AddColumns(
     'Medical Insurance Records' As Record,
     PlanCode,
     LookUp(
     'Medical Insurance Plan Codes',
     'Medical Insurance Plan Code' = Record.'Medical Insurance Record Plan Code'.'Medical Insurance Plan Code',
     {
     PlanCode: 'Medical Insurance Plan Code',
     Default: 'Medical Insurance Plan Code Default'
     }
     ),
     Grade,
     LookUp(
     'Medical Insurance Grade Subsidies',
     'Medical Insurance Grade Subsidy Grade Number' = Record.'Medical Insurance Record Grade'.'Medical Insurance Grade Subsidy Grade Number',
     {
     ChildSubsidy: 'Medical Insurance Grade Subsidy Child',
     AdultSubsidy: 'Medical Insurance Grade Subsidy Spouse',
     Percentage: 'Medical Insurance Grade Subsidy Percentage',
     Grade: 'Medical Insurance Grade Subsidy Grade'
     }
     )
     ),
     'Medical Insurance Record Employee Number' = Details.'Medical Insurance Details Employee Number'
     )

     

    And when inspecting the context variable instead of blank columns they are now instead '?'

     

    a1dancole_0-1716882471333.pnga1dancole_1-1716882489203.png

     

    Interestingly Percentage is populated and looking at the table schema this isn't the primary name column which is progress, but I don't know why.

     

    This is the row from the table that has been pulled back, that should have AdultSubsidy and ChildSubsidy as false instead of '?'

    a1dancole_2-1716882806500.png

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard