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 / UpdateContext by a Fie...
Power Apps
Answered

UpdateContext by a Field Value via a Lookup Entity Record

(0) ShareShare
ReportReport
Posted on by 473

I am trying to get 'Value' field of 'Configurations' entity, where 'Configuration'.'Key' matches "Default", and assign it to 'DefaultVar' field,

 

UpdateContext({DefaultVar: First(LookUp(Configurations, Key = "Default", Value))});​

 

but encountered an error "UpdateContext cannot be used in a property of the app object".

gymcode_0-1706688820451.png


Assuming there will only be a maximum of one returned result, may I know how can I formulate the statement?

Thank you.

Categories:
  • Verified answer
    SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @gymcode 

     

    You can't use the UpdateContext in the app object as it is a screen variable. 

    Instead, you can put it in the OnVisible property of the screen your app opens Screen1.OnVisible.

    Alternatively, if you want something in the OnStart property of the app, you can use a global variable Set function:

    Set(DefaultVar, First(LookUp(Configurations, Key = "Default", Value)));

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard