cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thunter
Post Prodigy
Post Prodigy

UpdateContext Error

Trying to build a Bing Map with our office locations. Getting the following error:

'UpdateContext' cannot be used in a property of the app object.

 

Here is my code in the OnStart - UpdateContext({plotPoints: Concat('Office Locations', "&pp=" & Latitude & "," & Longitude & ";" &"26"&";" & Title)})

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User III
Super User III

@thunter 

UpdateContext cannot be used in the OnStart property of an app.  Instead, you can put it in the OnVisible property of the screen your app opens to.

 

The reason is UpdateContext is only available while you are currently on a screen.  When the OnStart code is executed no screen has loaded yet.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

4 REPLIES 4
mdevaney
Super User III
Super User III

@thunter 

UpdateContext cannot be used in the OnStart property of an app.  Instead, you can put it in the OnVisible property of the screen your app opens to.

 

The reason is UpdateContext is only available while you are currently on a screen.  When the OnStart code is executed no screen has loaded yet.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@mdevaney 

 

That did work, however, now my map is not pulling the data from my SharePoint list. Any ideas?apimap.png

@thunter 

No idea.  I have not used the map control before.  I only knew how to get rid of the error.

 

Might be a good idea to close this thread and repost as a new problem.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

If you want something in the OnStart property of the app, you can instead use a global variable. Something like this:

Set(plotPoints, Concat('Office Locations', "&pp=" & Latitude & "," & Longitude & ";" &"26"&";" & Title))

Just wanted to share another alternative. However, as @mdevaney said, if your problem now is a diff one, it will be best to open a new thread.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (64,520)