Skip to content
Smarter by Design.Simpler for Business

ags forms ​

The ags forms command manages the login forms in which the user enters their identity information: the name, the title and the description of the form and the fields in it. Its panel equivalent is the Login Forms screen.

The form is the form step of the access flow. The values that the user enters pass to the flow and the authentication step uses them with the %AGS_USER_INPUT(field name) expression; for this reason the names of the form fields must fit the names that the provider expects.

Command Summary ​

TR7 WEB-CLI · ags forms
admin@TR7LBWAF01> ags forms list # list all of them
admin@TR7LBWAF01> ags forms show <id> # show one
admin@TR7LBWAF01> ags forms add name <name> … # new form
admin@TR7LBWAF01> ags forms update id <id> … # change
admin@TR7LBWAF01> ags forms delete <id> # delete
admin@TR7LBWAF01>  

Writing Order ​

Step 1 Create the form with its name
ags forms add name login-form

The only required field is the name, but a form without a field is not accepted: at least one form field must be given.
Step 2 Add the fields with an index
Every form field is a list item. First its type, then the settings of that type are written; the order of the fields on the screen is the index order.

--fields.0.fieldType text --fields.0.fieldName username
Step 3 Write the texts that appear
Every text that appears to the user, such as the label, the placeholder and the help text, consists of two fields: the type and the content.

--fields.0.label.type universal --fields.0.label.text "User name"
Step 4 Bind the form to the flow
The form does not work on its own; it is added to the flow of the gateway as a form step.

ags gateway update id <vService> --actions.0.actionType agsForms --actions.0.actionProfileId <form>

Required Fields ​

OrderFieldStatusValue
1nameRequiredThe unique name of the form
—--fields.0.…At least one fieldIt appears as optional in the completion list, but a form without a field is not accepted

The Multilingual Text Fields ​

Every text that appears to the user (title, description, the field label, the placeholder, the help text, the button text, the option text, the divider text, the information text) uses the same pattern: first the type, then the content according to the type.

TypeThe content fieldIts meaning
universal.textThe same text in all the languages (the default type)
localized.keyThe key resolved from the dictionary; the translation comes from the Dictionaries screen
default—The ready text of the system is used
none—The text is not shown
TR7 WEB-CLI · the two formats of writing a text
# the same text in all the languages
admin@TR7LBWAF01> --title.type universal --title.text "Corporate Sign In"
# the text resolved from the dictionary
admin@TR7LBWAF01> --title.type localized --title.key login_title
admin@TR7LBWAF01>  

The three parts of the text fields ​

Every text that uses the pattern opens into three fields on the command line. In the table below the relevant field name is written instead of <text>.

FieldWhat it doesWhat is written after it
--<text>.typeIt selects where the text will come fromuniversal (the default) · localized · default · none
--<text>.textIt writes the text directlyThe text that will appear; it opens only while type universal
--<text>.keyIt calls the text from the dictionaryThe key in the dictionary; it opens only while type localized

The texts that use the pattern and their full field names:

TextThe field names
The form title--title.type · --title.text · --title.key
The form description--description.type · --description.text · --description.key
The field label--fields.N.label.type · --fields.N.label.text · --fields.N.label.key
The field placeholder--fields.N.placeholder.type · --fields.N.placeholder.text · --fields.N.placeholder.key
The field help text--fields.N.helpText.type · --fields.N.helpText.text · --fields.N.helpText.key
The option text--fields.N.options.M.text.type · --fields.N.options.M.text.text · --fields.N.options.M.text.key
The submit button text--fields.N.buttonText.type · --fields.N.buttonText.text · --fields.N.buttonText.key
The button text in a button group--fields.N.buttons.M.text.type · --fields.N.buttons.M.text.text · --fields.N.buttons.M.text.key
The information text--fields.N.content.type · --fields.N.content.text · --fields.N.content.key
The divider text--fields.N.dividerText.type · --fields.N.dividerText.text · --fields.N.dividerText.key

The Field Types ​

FieldWhat it doesWhat is written after it
--fields.N.fieldTypeIt selects the type of the form field; the settings specific to the type open according to thisOne of the eighteen values below

The additional settings change according to the type:

fieldTypeThe panel nameThe settings specific to the type
textTextvalidationPattern · minLength · maxLength
passwordPasswordminLength · maxLength
emailEmail—
numberNumbermin · max
textareaMulti-line textrows (the default 4) · minLength · maxLength
selectSingle selectoptions.N.value · options.N.text.…
multipleSelectMultiple selectoptions.N.value · options.N.text.…
fileFileaccept · maxSize
date · time · datetimeDate · Time · Date and time—
checkboxCheckbox—
hiddenHidden fieldhiddenValue
submitButtonSubmit buttonbuttonText.… · buttonStyle · buttonIcon · submitBehavior · submitData.N.key · submitData.N.value
infoTextInformation textcontent.…
dividerDividerdividerText.…
customHtmlHTML contenthtmlContent
buttonGroupButton grouplayout · columns · buttons.N.…

The sub object fields are listed in every type

The sub fields such as options, buttons, submitData and content appear in the completion list independently of the field type. Writing them in an unrelated type does not do anything; the table above shows which setting belongs to which type.

The Settings Common to All the Fields ​

SettingDefaultNotes
--fields.N.fieldName—The name of the field in the flow; it begins with a letter and contains letters, digits and an underscore. It is not present in the divider, infoText and customHtml types
--fields.N.label.… · --fields.N.placeholder.… · --fields.N.helpText.…The text patternThe label, the placeholder and the help text
--fields.N.requiredfalseWhether it is obligatory for the user to fill it in; it is not present in the button, divider, information text and hidden fields
--fields.N.defaultValue—The value that the field will carry when it opens; it is not present in the button, divider, information text, hidden field and button group
--fields.N.condWithout a conditionThe field is shown only when the condition is met
--fields.N.assignToUserFields.0userIdThe user session field to which the value of the field will be copied; it is valid in the text, email, number, select and hidden types

The --fields.N.assignToUserFields.N field takes the following values: userId, username, email, displayName, firstName, lastName, phone, picture, locale, timezone, company, department, title, employeeId, groups.

The --fields.N.validationPattern field is valid only in the text type and takes the following values: None, email, domain, ip, port, url, alphanumeric, numeric.

The Full List of the Fields Specific to the Type ​

The full field names of the settings given briefly in the table above, what they do and in which field type they open:

FieldWhat it doesWhat is written after itIn which type
--fields.N.validationPatternIt checks the format of the value enteredNone · email · domain · ip · port · url · alphanumeric · numerictext
--fields.N.minLength · --fields.N.maxLengthIt limits the shortest and the longest length of the text to be enteredThe number of characterstext · password · textarea
--fields.N.rowsIt determines how many rows of the multi-line field will appearThe number of rows (the default 4)textarea
--fields.N.min · --fields.N.maxIt determines the lower and the upper limit of the number to be enteredA numbernumber
--fields.N.options.M.valueIt determines the value that the option will carry in the backgroundThe value; at least one option is neededselect · multipleSelect
--fields.N.acceptIt limits the file types that can be uploadedA file type list, for example .pdf,.pngfile
--fields.N.maxSizeIt determines the biggest file size that can be uploadedThe sizefile
--fields.N.buttonStyleIt selects the appearance of the submit buttonprimary (the default) · secondary · danger · success · customsubmitButton
--fields.N.buttonIconIt determines the icon of the submit buttonThe icon namesubmitButton
--fields.N.submitBehaviorIt selects which data will be carried in the submissionfullForm the whole of the form (the default) · merge it adds additional data to the form · override it sends only the data givensubmitButton
--fields.N.submitData.M.key · --fields.N.submitData.M.valueIt writes the name and value pairs to be added to the submissionThe field name and its valuesubmitButton, while submitBehavior is merge or override
--fields.N.htmlContentIt writes the HTML content to be embedded into the formThe HTML textcustomHtml
--fields.N.hiddenValueIt writes the value that the hidden field will carryThe valuehidden
--fields.N.layoutIt selects how the buttons in the button group will be arrangedhorizontal (the default) · vertical · gridbuttonGroup
--fields.N.columnsIt determines the number of columns in the grid layoutA number (the default 2); it opens only while --fields.N.layout gridbuttonGroup
--fields.N.buttons.M.valueIt determines the value that will be sent when the button is pressedThe valuebuttonGroup
--fields.N.buttons.M.condIt makes the button appear only in a certain caseA condition expressionbuttonGroup
--fields.N.buttons.M.iconIt determines the icon of the buttonThe icon namebuttonGroup
--fields.N.buttons.M.styleIt selects the appearance of the buttonprimary · secondary (the default) · danger · success · custombuttonGroup
--fields.N.buttons.M.backgroundColor · --fields.N.buttons.M.textColorIt determines the background and the text color of the buttonA color value; it is used when style custom is selectedbuttonGroup

Examples ​

TR7 WEB-CLI · A) The user name, the password and the submit button
admin@TR7LBWAF01> ags forms add name login-form \
--title.type universal --title.text "Corporate Sign In" \
--fields.0.fieldType text --fields.0.fieldName username \
--fields.0.label.type universal --fields.0.label.text "User name" --fields.0.required true \
--fields.1.fieldType password --fields.1.fieldName password \
--fields.1.label.type universal --fields.1.label.text "Password" --fields.1.required true \
--fields.2.fieldType submitButton --fields.2.fieldName submit \
--fields.2.buttonText.type universal --fields.2.buttonText.text "Sign in"
admin@TR7LBWAF01>  
TR7 WEB-CLI · B) A selection field and the validation
admin@TR7LBWAF01> ags forms update id <kimlik> \
--fields.3.fieldType select --fields.3.fieldName department \
--fields.3.options.0.value it --fields.3.options.0.text.type universal --fields.3.options.0.text.text "Information Technology" \
--fields.3.options.1.value hr --fields.3.options.1.text.type universal --fields.3.options.1.text.text "Human Resources" \
--fields.3.assignToUserFields.0 department
admin@TR7LBWAF01>  
TR7 WEB-CLI · C) An e-mail field, a text field with a pattern validation
admin@TR7LBWAF01> ags forms update id <kimlik> \
--fields.4.fieldType text --fields.4.fieldName institution_code \
--fields.4.validationPattern alphanumeric --fields.4.minLength 4 --fields.4.maxLength 12
admin@TR7LBWAF01>  

Updating and Deleting ​

The updating asks for the identifier with the id field and changes only the fields written. The field list is updated with the index; --fields.delete empties the whole of the list.

TR7 WEB-CLI · update and delete
admin@TR7LBWAF01> ags forms update id <id> --fields.0.label.text "E-mail address"
admin@TR7LBWAF01> ags forms update id <id> --fields.delete # remove all the fields
admin@TR7LBWAF01> ags forms delete <kimlik>
admin@TR7LBWAF01>  

Things to Know ​

  • The field names must fit the provider. The authentication providers expect the names username and password by default; if a different name will be used, the user name and password expressions of the provider must be updated as well.
  • A form without a field is not accepted. Even if the field list appears as optional in the completion list, at least one field is needed; a command without a field returns an error.
  • The order is the index order. The order in which the fields appear in the form is according to the --fields.0, --fields.1 … indexes; adding a field in between requires the indexes to be written again.
  • The texts with spaces require quotation marks. The values that contain a space such as the label and the title are written with double quotation marks.
  • The form does not work on its own. It is not used until it is added to the flow of the gateway as a form step.