PadCodedocs

Pick File

Opens Files so the person can choose a file.

Category: Device · Takes time: the next step waits for it

#When to use it

Use it to bring in a file from the Files app: a CSV to import, a JSON backup, a PDF.

#Example

An Import button: Pick File with Into: imported and Types: Csv. After it, imported.name is the file's name and imported.text its text.

#Good to know

  • It saves the file's name, type (its extension), size (in bytes) and, for plain text, CSV, TSV, Markdown and JSON files, its text. A JSON file's text is its values. A CSV's text is the file as written, not rows.
  • It needs no permission.
  • If the person closes Files without choosing, the run stops quietly.

#Add it

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

#Settings

SettingWhat it doesKindDefault
IntoWhere to save it.VariableRequired
TypesWhat kind of file.Choice: Any, Text, Pdf, Image, Json, Csvany

#What it gives back

{ name, type, size, text } (text only for text, JSON and CSV files; JSON is parsed).

#See also