Field Service Flow

Returns information corresponding to a field service flow. This resource is available in REST API version 42.0 and later.

This resource accepts the API name of a flow definition and returns information about the active flow version. If no flow version is activated, the most recent version is returned. Flow elements can be translated to the language of the user invoking this API by using Translation Workbench. If a particular flow version’s elements have been translated, the data returned uses the language of the query. To learn more, see Flow Components in Translation Workbench.

This resource is available to API users with Field Service mobile app user permissions and the Run Flows user permission.

Syntax 

URI: /services/data/vXX.X/support/fieldservice/Flow?developerNames=FLOW_UNIQUE_NAME

Where FLOW_UNIQUE_NAME is a variable.

Formats: JSON, XML

HTTP Method: GET

Authentication: Authorization: Bearer TOKEN

Where TOKEN is a variable.

Parameters:

ParameterDescription
developerNamesThe unique name for the flow definition. Currently, you can specify only one unique name using this parameter.

Response Body 

The following table describes the main elements of the response body.

FieldTypeDescription
FlowsArrayList of flows.
CreatedDateStringDate the flow was created.
DescriptionStringDescription of the flow.
FullNameStringFull name for the flow.
IdStringUnique ID for the flow.
LastModifiedDateStringDate the flow was last modified.
Metadata Flow metadata.
ChoicesArrayList of choices used by fields.
ChoiceTextStringText of choice.
DataTypeStringData type of choice.
NameStringName for the choice.
ScreensArray of objectsList of screens for the flow.
AllowBackBooleanWhether you can go back from the screen.
AllowFinishBooleanWhether you can finish the flow from the screen.
AllowPauseBooleanWhether you can pause from the screen.
FieldsArray of objectsList of fields used by the screen.
HelpTextStringHelp text for the screen.
LabelStringLabel for the screen.
LocationXNumberX coordinate for the screen.
LocationYNumberY coordinate for the screen.
NameStringName of the screen.
ProcessTypeStringType of process for the flow; in this case, it should be “FieldServiceMobile”.
StatusStringStatus of the flow.
VersionNumberNumberVersion number for the flow.

Example 

This sample request uses the unique name “FS_Flow” for the flow definition.

The response contains two screens.

Screen 1 contains two fields:

  • Field 1: a text field
  • RadioButton: a field with two choices

Screen 2 contains one field:

  • Field 2: a text field

Request:

GET

/services/data/v42.0/support/fieldservice/Flow?developerNames=FS_Flow

Response:

1{
2  "flows" : [ {
3    "Id" : "301R000000008grIAA",
4    "DefinitionId" : "300R00000004OLFIA2",
5    "MasterLabel" : "FS_Flow",
6    "ManageableState" : "unmanaged",
7    "VersionNumber" : 1,
8    "Status" : "Draft",
9    "Description" : "FS Flow",
10    "ProcessType" : "FieldServiceMobile",
11    "CreatedDate" : "2017-12-05T19:22:16.000+0000",
12    "CreatedById" : "005R0000000J2glIAC",
13    "LastModifiedDate" : "2017-12-05T19:22:16.000+0000",
14    "LastModifiedById" : "005R0000000J2glIAC",
15    "Metadata" : {
16      "actionCalls" : null,
17      "apexPluginCalls" : null,
18      "assignments" : null,
19      "choices" : [ {
20        "choiceText" : "Choice A",
21        "dataType" : "String",
22        "description" : null,
23        "name" : "Choice_A",
24        "processMetadataValues" : null,
25        "userInput" : null,
26        "value" : null
27      }, {
28        "choiceText" : "Choice B",
29        "dataType" : "String",
30        "description" : null,
31        "name" : "Choice_B",
32        "processMetadataValues" : null,
33        "userInput" : null,
34        "value" : null
35      } ],
36      "constants" : null,
37      "decisions" : null,
38      "description" : "FS Flow",
39      "dynamicChoiceSets" : null,
40      "formulas" : null,
41      "fullName" : "FS_Flow-1",
42      "interviewLabel" : "FS_Flow {!$Flow.CurrentDateTime}",
43      "label" : "FS Flow",
44      "loops" : null,
45      "module" : null,
46      "processMetadataValues" : null,
47      "processType" : "FieldServiceMobile",
48      "recordCreates" : null,
49      "recordDeletes" : null,
50      "recordLookups" : null,
51      "recordUpdates" : null,
52      "screens" : [ {
53        "allowBack" : true,
54        "allowFinish" : true,
55        "allowPause" : true,
56        "connector" : {
57          "processMetadataValues" : null,
58          "targetReference" : "Screen_2"
59        },
60        "description" : null,
61        "fields" : [ {
62          "choiceReferences" : null,
63          "dataType" : "String",
64          "defaultSelectedChoiceReference" : null,
65          "defaultValue" : null,
66          "description" : null,
67          "extensionName" : null,
68          "fieldText" : "Field 1",
69          "fieldType" : "InputField",
70          "helpText" : "Help Text 1",
71          "inputParameters" : [ ],
72          "isRequired" : false,
73          "isVisible" : null,
74          "name" : "Field_1",
75          "outputParameters" : [ ],
76          "processMetadataValues" : null,
77          "scale" : null,
78          "validationRule" : null
79        }, {
80          "choiceReferences" : [ "Choice_A", "Choice_B" ],
81          "dataType" : "String",
82          "defaultSelectedChoiceReference" : null,
83          "defaultValue" : null,
84          "description" : null,
85          "extensionName" : null,
86          "fieldText" : "Pick a choice",
87          "fieldType" : "RadioButtons",
88          "helpText" : "Pick a Choice help text",
89          "inputParameters" : [ ],
90          "isRequired" : false,
91          "isVisible" : null,
92          "name" : "Pick_a_choice",
93          "outputParameters" : [ ],
94          "processMetadataValues" : null,
95          "scale" : null,
96          "validationRule" : null
97        } ],
98        "helpText" : null,
99        "label" : "Screen 1",
100        "locationX" : 189,
101        "locationY" : 178,
102        "name" : "Screen_1",
103        "pausedText" : null,
104        "processMetadataValues" : null,
105        "rules" : null,
106        "showFooter" : true,
107        "showHeader" : true
108      }, {
109        "allowBack" : true,
110        "allowFinish" : true,
111        "allowPause" : true,
112        "connector" : null,
113        "description" : null,
114        "fields" : [ {
115          "choiceReferences" : null,
116          "dataType" : "String",
117          "defaultSelectedChoiceReference" : null,
118          "defaultValue" : null,
119          "description" : null,
120          "extensionName" : null,
121          "fieldText" : "Field 1",
122          "fieldType" : "InputField",
123          "helpText" : null,
124          "inputParameters" : [ ],
125          "isRequired" : false,
126          "isVisible" : null,
127          "name" : "Field_1",
128          "outputParameters" : [ ],
129          "processMetadataValues" : null,
130          "scale" : null,
131          "validationRule" : null
132        } ],
133        "helpText" : null,
134        "label" : "Screen 2",
135        "locationX" : 437,
136        "locationY" : 289,
137        "name" : "Screen_2",
138        "pausedText" : null,
139        "processMetadataValues" : null,
140        "rules" : null,
141        "showFooter" : true,
142        "showHeader" : true
143      } ],
144      "startElementReference" : "Screen_1",
145      "steps" : null,
146      "subflows" : null,
147      "textTemplates" : null,
148      "urls" : null,
149      "variables" : null,
150      "waits" : null
151    },
152    "FullName" : "FS_Flow-1"
153  } ]
154}