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

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

Highlighted
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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,505)