Hello,
I am using a button to pull GPS coordinates that will populate 2 fields. the following in the OnSelect property errors out:
If(CBLLat=Blank(), UpdateContext({CBLLat:Location.Latitude}); UpdateContext({CBLLong:Location.Longitude}), UpdateContext({CBLLat:Blank()}); UpdateContext({CBLLong:Blank()}))
This also errors out for the location: Round(Acos(Sin(Radians(Location.Latitude)
The first error is an invalid argument type where CBLLat=BLank(), and the latter two are "Invalid use of '.'" in each Location function.These same formulas work in other screens on the same app. Does anyone know why this may be occurring, especially when in other screens these errors do not occur?
Solved! Go to Solution.
You may see this error if you have a column called 'Location' in the data source that is associated with the Form - within the form when you type 'Location' it will refer to the column of the object, not to the global Location signal. If this is the case, try using the disambiguation operator to
If(
CBLLat = Blank(),
UpdateContext({ CBLLat:[@Location].Latitude, CBLLong:[@Location].Longitude }),
UpdateContext({ CBLLat:Blank(), CBLLong:Blank() }))
Hope this helps!
Are the context variables CBLLat and CBLLong defined elsewhere (you can check on the View -> Variables option in the ribbon)? I tried defining the same expression that you used, and didn't see any errors.
Hi there,
No, the context variables are not defined elsewhere. I have tried with different variable names and it resulted in the same issue. One thing to note is that this error occurs within the Data Card, but works fine outside. In addition, these same Location.Longitude and Location.Latitude work in other Screens of the same app, but now not in any new ones I've been adding.
You may see this error if you have a column called 'Location' in the data source that is associated with the Form - within the form when you type 'Location' it will refer to the column of the object, not to the global Location signal. If this is the case, try using the disambiguation operator to
If(
CBLLat = Blank(),
UpdateContext({ CBLLat:[@Location].Latitude, CBLLong:[@Location].Longitude }),
UpdateContext({ CBLLat:Blank(), CBLLong:Blank() }))
Hope this helps!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
177 | |
52 | |
41 | |
36 | |
27 |
User | Count |
---|---|
240 | |
81 | |
71 | |
69 | |
66 |