Ask for Input / AskforInput (internally is.workflow.actions.ask)

This action requires that Shortcuts has permission to use WFUserInteractionResource.

description

summary

Displays a dialog prompting the user to enter a piece of information.

usage

AskforInput question="string" defaultAnswer="string" defaultAnswer2="string" inputType=("Text" | "Number" | "URL" | "Date") granularity=("Date" | "Time" | "Date and Time") skiptoWatchDictation=(true | false | variable)

arguments


question: Text (Docs)

Placeholder: "Enter text" Allows Variables: true

Accepts a string or text with the text. Does not allow newlines.


defaultAnswer: Text (Docs)

Placeholder: "optional" Allows Variables: true

Only enabled if: argument WFInputType != Date

Accepts a string or text with the text. Does not allow newlines.


defaultAnswer2: Date (Docs)

Placeholder: "June 29, 2007" Allows Variables: true

Only enabled if: argument WFInputType == Date

Accepts a string or text with the text. Does not allow newlines.


inputType: Enumeration (Docs)

Default Value: "Text" Allows Variables: true

Accepts a string or variable containing one of the options:

  • Text
  • Number
  • URL
  • Date

granularity: Enumeration (Docs)

Default Value: "Date" Allows Variables: true

Only enabled if: argument WFInputType == Date

Accepts a string or variable containing one of the options:

  • Date
  • Time
  • Date and Time

skiptoWatchDictation: Switch (Docs)

Allows Variables: true

Only enabled if: argument WFInputType != Date

Only enabled if: Workflow type is WatchKit. This action is always enabled inside Shortcutslang.

Only enabled if: This action is always disabled inside Shortcutslang.

Accepts a boolean or a variable.


source json (for developers)

{
	"ActionClass": "WFAskForInputAction",
	"ActionKeywords": [
		"ask",
		"prompt",
		"show",
		"dialog",
		"keyboard",
		"text",
		"number",
		"url",
		"date",
		"time"
	],
	"Category": "Scripting",
	"Description": {
		"DescriptionSummary": "Displays a dialog prompting the user to enter a piece of information."
	},
	"IconName": "Scripting.png",
	"LastModifiedDate": "2015-08-20T07:00:00.000Z",
	"Name": "Ask for Input",
	"Output": {
		"Multiple": false,
		"OutputName": "Ask for Input",
		"Types": [
			"NSString",
			"NSDecimalNumber",
			"NSURL",
			"NSDate"
		]
	},
	"Parameters": [
		{
			"Class": "WFTextInputParameter",
			"DisallowedVariableTypes": [
				"Ask"
			],
			"Key": "WFAskActionPrompt",
			"Label": "Question",
			"Placeholder": "Enter text",
			"TextAlignment": "Right"
		},
		{
			"Class": "WFTextInputParameter",
			"DisallowedVariableTypes": [
				"Ask"
			],
			"Key": "WFAskActionDefaultAnswer",
			"Label": "Default Answer",
			"Placeholder": "optional",
			"RequiredResources": [
				{
					"WFParameterKey": "WFInputType",
					"WFParameterRelation": "!=",
					"WFParameterValue": "Date",
					"WFResourceClass": "WFParameterRelationResource"
				}
			],
			"TextAlignment": "Right"
		},
		{
			"Class": "WFDateFieldParameter",
			"DisallowedVariableTypes": [
				"Ask"
			],
			"Key": "WFAskActionDefaultAnswerDate",
			"Label": "Default Answer",
			"Placeholder": "June 29, 2007",
			"RequiredResources": [
				{
					"WFParameterKey": "WFInputType",
					"WFParameterValue": "Date",
					"WFResourceClass": "WFParameterRelationResource"
				}
			],
			"TextAlignment": "Right"
		},
		{
			"Class": "WFEnumerationParameter",
			"DefaultValue": "Text",
			"DisallowedVariableTypes": [
				"Ask"
			],
			"Items": [
				"Text",
				"Number",
				"URL",
				"Date"
			],
			"Key": "WFInputType",
			"Label": "Input Type"
		},
		{
			"Class": "WFEnumerationParameter",
			"DefaultValue": "Date",
			"DisallowedVariableTypes": [
				"Ask"
			],
			"Items": [
				"Date",
				"Time",
				"Date and Time"
			],
			"Key": "WFAskActionDateGranularity",
			"Label": "Granularity",
			"RequiredResources": [
				{
					"WFParameterKey": "WFInputType",
					"WFParameterValue": "Date",
					"WFResourceClass": "WFParameterRelationResource"
				}
			]
		},
		{
			"Class": "WFSwitchParameter",
			"Description": "When enabled and run on Apple Watch, this action immediately begins listening for voice input.",
			"DisallowedVariableTypes": [
				"Ask"
			],
			"Hidden": true,
			"Key": "WFAskActionImmediateDictation",
			"Label": "Skip to Watch Dictation",
			"RequiredResources": [
				{
					"WFParameterKey": "WFInputType",
					"WFParameterRelation": "!=",
					"WFParameterValue": "Date",
					"WFResourceClass": "WFParameterRelationResource"
				},
				{
					"WFResourceClass": "WFWorkflowTypeResource",
					"WFWorkflowType": "WatchKit"
				}
			]
		}
	],
	"RequiredResources": [
		"WFUserInteractionResource"
	],
	"Subcategory": "Notification",
	"UserInterfaces": [
		"UIKit",
		"UIKitWidget",
		"WatchKit"
	]
}