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 / Error with Many Levels...
Power Apps
Answered

Error with Many Levels of many-to-one Expansion aren't supported... but i don't think i'm doing that. help?

(0) ShareShare
ReportReport
Posted on by 11

Hello,  On the "onvisible" property of a screen, i have the following:

UpdateContext({thisExpense:LookUp(tbl_expenses,tbl_expense=expenseId)});//expenseId passed in context
UpdateContext({thisBudget:LookUp(tbl_budgets,tbl_budget=thisExpense.budget.tbl_budget)});

 

I have two objects, a tbl_budget that is parent to a tbl_expense.  i keep getting a "many-to-one relationship expansion" error on the 2nd line (lookup for tbl_budget).  Do you know why i would get an error?  i'm only using the parent table in the lookup.

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @swaroopreddy It's probably because you are using the dot notation two levels deep,

    thisExpense.budget.tbl_budget
    Normally you could go only one level deep. To avoid this you have to do another LookUp.

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • swaroopreddy Profile Picture
    11 on at

    But that's a field  of the Tel_.budget table, so it's only one relationship deep.  how can it be formatted to use another lookup?  any ideas would be super helpful

  • Verified answer
    swaroopreddy Profile Picture
    11 on at

    This took me a little bit to fix, but I finally found the problem.  To help anyone I the future, I'll detail what I now understand here:

     

    1.  Overall, a context variable in PowerApps can be in one of two states of loading (scope); "fully loaded" gives all properties and immediate relationships, and "partially loaded" gives all properties without loading relationships.  For example; if I had three tables : country, state, city with obvious parent child relationships and properties (name, abbreviation... etc.)... a "fully loaded" state would have the country table and all its properties available, but a "partially loaded" state would have the properties (like name, abbreviation) available, but you wouldn't be able to access the country parent relationship.

     

    2.  That is an important concept to understand, because it applies to how you use the variables... as PowerApps allows you to load a variable in multiple ways... for example:

     

    LookUp & Filter... etc.- loads the variables as "fully loaded" i.e. LookUp(states, state="NY")

    Patch - Loads the variable as "partially loaded" i.e. UpdateContext({Patch(states, thisState, {country:us}) will return a partially loaded state.

    Accessing a variable as a relationship from a "fully loaded" variable gives you a "partially loaded" variable.. i.e. UpdateContext{thisCountry: thisState.country});

     

    3.  Now the final bit.  On a screen, Powerapps looks for the most restrictive scope used of a variable, and assumes that in its validation, so even if at the beginning of an "onVisible" property, I use a LookUp to load a variable, if I later update the context with the Patch function, PowerApps assumes all references to the variable are "partially loaded", and writes the error.  You need to make sure all updates of a variable are "fully loaded" if you are accessing a parent relationship.

     

    This may seem confusing, but it seemed to work for me (we have.a complex app that we built).  Hoping this helps you on your endeavors.

     

     

     

     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard