cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Help with LookUp Columns - CDS Entities returning null data for lookups in PowerApps

Hello,

 

I've posted about this twice before over the past month with no answer from anyone from Microsoft, and now my project is way behind.

I have a PowerApp Canvas App I'm developing with the new CDS for Apps.
One of my custom entities has six lookup columns which I'm trying to load into a form from a Gallery.

When I open an item from the Gallery in a Form, most of the time it WILL NOT load LookUp data.
When I try to display the lookup information in the "DefaultSelectedItems" function, it is blank because the lookup data is blank.

When I compare the data of the Entity Row to what's in the database, it shows values for the lookups.
However, in the app it is 'blank'.  

This issue comes and goes (sometimes it works, usually it does not) and I can't make heads or tails of it.

How can I query for a specific entity row and ensure that ALL the columns, including the lookup columns, have data in them?  Is this an issue that is Microsoft is aware of, or is it possibly something I'm doing wrong?

27 REPLIES 27

Hi @AccuFloDev 

I'm new with powerapps, thats why i need to reanimate this thread..

 


@AccuFloDev wrote:

 


In regards to my issue, I'm trying to improve performance of an app by making it work mostly offline until the user initiates a sync on demand. 


Could you please share me the formula for this part please?

Thanks,

 

BR.

pytbyt

 

 


@PytByt wrote:

Hi @AccuFloDev 

I'm new with powerapps, thats why i need to reanimate this thread..

 


@AccuFloDev wrote:

 


In regards to my issue, I'm trying to improve performance of an app by making it work mostly offline until the user initiates a sync on demand. 


Could you please share me the formula for this part please?

Thanks,

 

BR.

pytbyt

 

 


Hey @PytByt ,

The functionality I was describing isn't all in a single formula - could you be more specific as to the information you're looking for?  I'll try to provide what I can.

Hey @KelvinBox ,


I was unable to get the lookups to show using labels on a page prior to the call to Collect().
I was however able to get the lookups working using a slightly different method;
I may also have found an alternative to using First() that may have less of a hit on the device storage:

 

Here's a basic outline of the steps I used:

  1. On app launch, navigate to a 'splash' screen which will grab online data (if connected) through a series of buttons which iterate through all the entities I need to grab.

  2. On this same page, I have added forms for every entity with lookup values I need to pull in: 1-form-per-entity.
    Each form has DataCards for the following:

    1. A DataCard for each required lookup column.
      • Ensure that the Combo Box for the lookup field shows a value that is guaranteed to have data, such as the Id column of the lookup entity.

    2. A DataCard for the Entity's Id (The Entity with the lookup column, not the lookup's Id)
      This will reassure you that you are indeed getting entity data.

  3. Set the DataSource property of each form to a CDS Entity you need lookup columns for.

  4. On the Items property of each form, use code similar to the example below to pull in a single row.
    According to Microsoft the code is delegable , so hopefully this avoids the caching issue when using First()
    LookUp(
        'My Entity', //CDS Entity
        Not(IsBlank('My Entity Id')) //Get an item where the ID column isn't blank (This guarantees you get a result, if one exists - ID can't be blank)
    )
  5. (Optional) Set the Visibility of these forms to false unless some debug flag is active

  6. After data has been cached on the splash page, navigate to your app's first screen (where your galleries and forms should be).

This has worked to get the lookups showing consistently.  I am running into another issue now with having to Refresh() data sources twice before data comes in, but at least it's bringing in the Lookup values now.
(I will be creating a separate thread on the Refresh issue)

 

Anyway, if you have any questions on my methodology above please let me know.

Hi @AccuFloDev 

I need to know what formula is use to make the offline features. 

I mean, i already use the collection, and i also know about the SaveData and LoadData function. But i haven't really know how to use it and where to put it.

 

That's is why i'm interest in your solution which make the app work mostly offline until the user initiates a sync on demand.

 

I also need to know to automatically sync when Connection is connected.

 

Hope you could help.

 

Thank,

BR.

pytbyt


@PytByt wrote:

Hi @AccuFloDev 

I need to know what formula is use to make the offline features. 

I mean, i already use the collection, and i also know about the SaveData and LoadData function. But i haven't really know how to use it and where to put it.

 

That's is why i'm interest in your solution which make the app work mostly offline until the user initiates a sync on demand.

 

I also need to know to automatically sync when Connection is connected.

 

Hope you could help.

 

Thank,

BR.

pytbyt




Hey @PytByt ,

That's a bit of a loaded question, I'm not sure if I can provide you enough info here in the forums to cover that broad topic, but I can point you in the right direction to some blog articles on the subject take a look at these and let me know if you have any specific questions that aren't covered in the articles:

 

  1. Implementing Offline Capabilities for Relational Data
  2. Implementing Offline Capabilities in your App
  3. Develop offline-capable canvas apps

 

In regards to:

I also need to know to automatically sync when Connection is connected.


There are probably a lot of ways to do this, but my preferred method is to have a button on the apps 'main' screen which runs the 'sync' code.  You could trigger this in a couple of ways:

 

  1. Use the Screens OnVisible property to detect if connected and if so, click the sync button.
    This will have the behaviour of syncing when the screen first loads when the device is connected:
    //Screens OnVisible Property
    If(
      Connection.Connected,
      Select('Sync Button');
    );
  2. To have a screen automatically detect a change in the connection state then run the sync, you could use a Toggle control on the page you wish to do that on, set up something like this:

    *Disclaimer - I haven't tested this code to see if it works, please let me know if you have issues*
    //Toggle Control 'Default' Property
    Connection.Connected
    //Toggle Control 'OnCheck' Property
    //This code will run only when the connection state changes from false to true
    Select('Sync Button');
    You can then set the Visible property of the toggle to false to the users can't manually change the toggle.
alexis
Frequent Visitor

I'm facing the same issue here.

It's the first time I use the CDS and I just spent the day trying to figure out why it does not work.

I tried the First(Filter()) solution but it does not work better.

 

I can't use the Gallery control solution so I don't really know what to do from here.

 

Any updates from Microsoft on when the issue would be resolved ?

 

Thanks

I think the response from @AccuFloDev to me above is still relevant and hasn’t changed unfortunately. 

if you provide specific examples of what you’re doing we can probably help 🙂

Hi,

Yes here's a bit more context:
My tables are: Employees and JobType and the relationship between the 2 tables is:
alexis_0-1605714534995.jpeg

 

 
The issue is when I request a row from the Employee table using the LookUp() or First(Filter()) functions, the Lookup Columns retrieved are always Blank() although there is data in it. I tried getting the result from OnStart, OnVisible, OnSelect, into a global or a local variable and the result is the same every time. All LookUp Columns are always Blank(), No Exceptions.

I'll try the solution from @AccuFloDev  using the Spash Screen. 
By the way, how are the refreshed handled using this solution ?

Thanks

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (811)