PadCodedocs

Get Location

Finds where the iPad is right now.

Category: Device · Can fail (wrap it in Try to handle that) · Takes time: the next step waits for it

#When to use it

Use it to find where the iPad is right now: the weather here, places nearby, where an entry was made.

#Example

A weather screen's When Loading:

  1. Get Location with Into: here.
  2. Call API with Query fields latitude (⚡︎ → Formula… here.latitude) and longitude (here.longitude).

#Good to know

  • It needs Location. The first time, your app shows the reason you wrote under Data & Logic → Permissions, then iPadOS asks.
  • It saves latitude, longitude and accuracy (in meters).
  • If there's no location within 15 seconds, or Location is turned off, the step fails.

#Add it

Select a view, open the Inspector's Actions tab, pick when it runs, tap Add action and choose Get Location (under Device). Tap the step to open its settings.

#Settings

SettingWhat it doesKindDefault
IntoWhere to save it.VariableRequired

#What it gives back

{ latitude, longitude, accuracy } (accuracy in meters).

#See also