cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thunter
Level 8

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
Super User
Super User

Re: UpdateContext Error

@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
Super User
Super User

Re: UpdateContext Error

@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

thunter
Level 8

Re: UpdateContext Error

@mdevaney 

 

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

Highlighted
Super User
Super User

Re: UpdateContext Error

@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."

Super User
Super User

Re: UpdateContext Error

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,354)