ExtractFormData, GetFormValue/GetFormData, and SetFormValue/SetFormData support browser-style HTML form workflows.
The usual pattern is: request the page, extract the form, inspect or modify fields, then submit the form as application/x-www-form-urlencoded content.
Requestdownloads the page that contains the form.ExtractFormDataparses the response body into a reusable form object.GetFormValueorSetFormValuereads or edits individual fields.Requestsubmits the form object as the request body.
{
"ExtractFormData": {
"ResponseObjectName": "LoginResponse",
"FormObjectName": "LoginForm",
"XPath": "//form[@id='login_form']",
"ContainsSecret": false
}
}| Name | Type | Required? | Description |
|---|---|---|---|
ResponseObjectName |
String | Yes | Response object that contains the HTML page. |
FormObjectName |
String | Yes | Variable name for the extracted form object. |
XPath |
String | No | XPath selector used to pick a specific <form> element. |
ContainsSecret |
Boolean | No | Masks extracted form values in logs. Default is false. |
GetFormData is an alias of GetFormValue.
{
"GetFormValue": {
"FormObjectName": "LoginForm",
"InputName": "authenticity_token",
"VariableName": "AuthToken",
"ContainsSecret": true
}
}| Name | Type | Required? | Description |
|---|---|---|---|
FormObjectName |
String | Yes | Existing form object to read from. |
InputName |
String | Yes | Input name to fetch. |
VariableName |
String | Yes | Variable that receives the input value. |
ContainsSecret |
Boolean | No | Marks the stored value as secret. Default is false. |
SetFormData is an alias of SetFormValue.
{
"SetFormValue": {
"FormObjectName": "LoginForm",
"CreateForm": "DoNotCreate",
"InputName": "session[password]",
"Value": "%LoginPassword%",
"IsSecret": true
}
}| Name | Type | Required? | Description |
|---|---|---|---|
FormObjectName |
String | Yes | Existing or new form object to edit. |
CreateForm |
String | No | Form creation behavior: DoNotCreate, CreateIfNotFound, CreateOrFail, or CreateOrReplace. Default is CreateIfNotFound. |
InputName |
String | No | Field name to add or replace. Omit it when you only want to create an empty form object. |
Value |
String expression | No | Value assigned to InputName. |
IsSecret |
Boolean | No | Masks the value in logs. Default is false. |
From samples/http/twitter/CustomTwitter.json:
{
"ExtractFormData": {
"ResponseObjectName": "LoginResponse",
"FormObjectName": "LoginForm"
}
}
{
"Condition": {
"If": "LoginForm == null",
"Then": {
"Do": [
{ "Throw": { "Value": "Error, login form not found" } }
]
}
}
}From samples/http/twitter/CustomTwitter.json:
{
"SetFormValue": {
"FormObjectName": "LoginForm",
"CreateForm": "DoNotCreate",
"InputName": "session[username_or_email]",
"Value": "%LoginUserName%"
}
}
{
"SetFormValue": {
"FormObjectName": "LoginForm",
"CreateForm": "DoNotCreate",
"InputName": "session[password]",
"Value": "%LoginPassword%",
"IsSecret": true
}
}From the built-in System/Twitter.json platform definition:
{
"SetFormData": {
"FormObjectName": "LoginForm",
"CreateForm": "DoNotCreate",
"InputName": "session[username_or_email]",
"Value": "%LoginUserName%"
}
}From samples/http/twitter/CustomTwitter.json:
{
"Request": {
"Verb": "Post",
"Url": "sessions",
"RequestObjectName": "LoginPostRequest",
"ResponseObjectName": "Global:LoginPostResponse",
"AllowRedirect": false,
"Content": {
"ContentObjectName": "LoginForm",
"ContentType": "application/x-www-form-urlencoded"
}
}
}
ExtractFormDatawritesnullwhen no matching form is found. The Twitter and Facebook samples immediately test forFormObjectName == nullbefore continuing.
Use
CreateForm: "DoNotCreate"when you expect a real extracted form and want a missing form to fail loudly.
GetFormDataandSetFormDataare legacy-friendly aliases. PreferGetFormValueandSetFormValuein new documentation because they are clearer.