PadCodedocs

Show Alert

Shows an alert or a dialog with buttons. Each button can run its own steps.

Category: Messages & Feedback

#When to use it

Use it to ask before something that can't be undone, to let the person choose between a few options, or to ask for one short answer.

#Example

A note's Delete button, When Tapped:

  • Title: Delete this note?
  • Buttons: tap Add button, title it Delete and set its role to Destructive. Inside it, add Remove from List and Go Back / Close.
  • Tap Add button again for a Cancel button with role Cancel and no steps.

#Good to know

  • The run waits for an answer. Then the tapped button's steps run, then the steps after Show Alert.
  • With Input, the alert has a text field. What's typed is saved into that variable when the alert closes, before the button's steps run.
  • Style: Dialog shows the buttons as a list of choices instead of a centered alert.
  • With no buttons, the alert has one OK button.

#Add it

Select a view, open the Inspector's Actions tab, pick when it runs, tap Add action and choose Show Alert (under Messages & Feedback). Tap the step to open its settings.

#Settings

SettingWhat it doesKindDefault
TitleThe bold first line.TextRequired
MessageMore detail under the title.Text
ButtonsThe buttons. A destructive one shows in red; a cancel one closes without doing anything.Buttons[{'title': 'OK'}]
StyleA centered alert, or a dialog of choices.Choice: Alert, Dialogalert
InputAdds a text field; what's typed goes into this value.VariableOptional
PlaceholderGray hint text in the field.Text

#See also