Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

While creating a template, you may need to define template and transaction parameters based on your need. This document guides you on how to use the different types of parameters. It also describes how do these parameters function with different settings.

This page also discusses the characteristics of the various fields on the Add Template/Transaction Parameters screen and their effects on the parameters' representation.

Table of Contents
maxLevel3

On the following screen, when you click Add Parameter, it guides you to the page that lets you add the template or transaction parameters.


Info
Defining parameters is an optional step during template creation. 

Below is the screen that asks you for the details described in the table that follows to add a parameter.

Fields

Description

GroupUnique name to identify a group.
NameName of the parameter.
Display NameDisplay name for the Parameter. This display name will be visible instead of the Parameter's actual name on the Parameter Values page.
TooltipMessage that you want to show as a tooltip for the Parameter.
Parameter TypeType of the input parameter to be received from the Partner.
MandatoryParameter may be mandatory or optional. By default, the parameters are mandatory.
Default ValueDefault value of the parameter.

Fields' details explained

As you set the values for some of these fields, for example, Display NameTooltip, the corresponding changes reflect in several pages related to the templates and transactions. You may also need to do some additional settings in case of some specific type of parameters, for example, Combo and Text. The following sections talk of these fields, their possible values and settings, and the changes they bring into effect.

Display Name: The name you enter in this field appears on the following pages:

  • Add Template Parameters 
  • Add Transaction Parameters
  • View Template
  • View Transaction
  • Parameter Values
  • Template Parameter Preview

Tooltip:  The message you enter in this field can be seen as a tooltip for the parameter in the following pages:

  • Parameter Values
  • Template Parameter Preview

Parameter Type: Depending on the Parameter Type you have selected, you may have to define some additional fields/options or settings while defining a parameter. The following points underline the characteristics of a set of some parameter types in terms of options and settings.

  • Below is the set of validation fields you encounter if you select the parameter types given in the table that follows. You can perform a validation check on the parameters using these fields.
    • Maximum Length - Enter the maximum length (in number) allowed for the parameter.
    • Pattern - Set the pattern for the Parameter. It should be defined in a regular expression. 
    • Test Pattern - Check the validity of the expression in the Pattern field by giving a value in this field.

Parameter Types

Validation fields
Max LengthPatternTest Pattern
ComboNoNoNo
PasswordYesYesYes
Text FieldYesYesYes

Text Area

YesYesYes
Radio ButtonNo

No

No
Date Field NoNoNo
CheckboxNoNoNo
EmailYesNoNo
URLYesNoNo
NumberNoNoNo
Decimal Number(Float)NoNoNo


Info
Pattern and Test Pattern fields' values should be a regex written in JavaScript only.
  • If you select the Combo as the Parameter Type, you can provide the value either manually by entering a list of options in the Value field or dynamically by calling a REST Consumer. 

    Info

    The response received from the REST call in case of a Combo parameter is always in the JSON format. Below is an example of the JSON response that you receive.

    Code Block
    themeMidnight
    titleSample JSON Response
    [
        {
            "value": "AllDays"
        },
        {
            "value": "BusinessDays"
        },
        {
            "value": "WeekDays"
        }
    ]


    To call a REST Consumer to populate the values: 

    1. Select the Dynamic check box.
    2. In the Select REST Consumer field, select a REST Consumer from the list. You can also create a new REST Consumer by clicking the sign.
      The parameter values are populated in the Default Value field. You can apply sorting on the retrieved values by selecting Apply Sorting check box.

      Info
      A REST Consumer here should support the Get method and Basic Authentication only.


  • If you select the CheckBox as the Parameter Type, you can select any of the following three values in the Select CheckBox Value field.
    • true/false
    • on/off
    • 1/0
    The default value for each of the selected options is Unchecked.  You can change the default value to Checked based on your requirement.

REST Consumer response

The response received from the REST call in case of a Combo parameter is always in the JSON format. Below is an example of the JSON response that you receive.

Code Block
themeMidnight
titleSample JSON Response
[ { "value": "AllDays" }, { "value": "BusinessDays" }, { "value": "WeekDays" } ]

Adding Validation to a Transaction Parameter

Cant have fields with same names in different groups

No error is thrown when an editable or mandatory field is made invisible


Code Block
{
	validation :{
		mandatory:['State' comma separated fields name],
		nonMandatory:['City'],
		editable:['State', 'City'],
		nonEditable:[],
		visibile:['State', 'City'],
		nonVisible:[],
		hideGroups:['GroupB']
	},
	values:[
		{
			fieldName: 'State',
			values : ['UK','Maharastra'],
			defaultValue:'UK'
		}
	]
}


You can add validation to a transaction parameter (field) to dynamically perform a resultant action on another field. For example, configuring a transaction parameter (field) such that a change in its value modifies another field's default value and makes the field non-editable.

You can use the following attributes of a field to have a resultant action on it when there is a changes in the value of the field to which you have added the validation.

Info
You cannot modify the value for an any attribute of a field to which you have added the validation.


AttributeValueDescription

Mandatory

Yes/NoSelect Yes to make the field mandatory.

Visibility

Yes/NoSelect Yes to make the field visible.

Editable

Yes/NoSelect Yes to make the field editable.
Default Value<User defined>Enter a default value

You can add validation either by using the GUI or the customizable API provided by Adeptia.

Anchor
GUI
GUI
Adding validation using GUI

Follow the steps below to add validation to a transaction parameter using GUI:

On the Define Parameters page, Add Transaction Parameters (Optional) section,

  1. Select the parameter (field) for which you want to add validation and Click More  > Add  Validation.
  2. On Add Validation for field on change screen, in the  Rule Definition Criteria, select an option GUI. By default, the GUI option is selected.

  3. In the field Provide field value on which the rule will be applied, provide the value(s) on which you want to define the rule. 

    Info
    • You can provide values maximum up to four.
    • When the provided value is entered, the defined rule for value will be applied on the target field(s). 

    Once you provided the value(s), you need to define the following rules for each value.

    1. In the Hide Group field, select the group you want to hide.

    2. In the Select target field(s), select the field(s) on which you want to apply the rule, and define the following actions for selected field(s).

      AttributeValueDescription

      Mandatory

      Yes/NoSelect Yes to make the field mandatory.

      Visibility

      Yes/NoSelect Yes to make the field visible.

      Editable

      Yes/NoSelect Yes to make the field editable.
      Default Value<User defined>Enter/select a default value


      Info
      Based on the selected field type while adding a parameter, the list of actions will differ.


  4. Click Save.

Anchor
API
API
Adding validation using API

Follow the steps below to add validation to a transaction parameter using API:

On the Define Parameters page, Add Transaction Parameters (Optional) section,

  1. Select the parameter (field) for which you want to add validation and Click More  > Add  Validation.
  2. On Add Validation for field on change screen, in the  Rule Definition Criteria, select an option API. By default, the GUI option is selected.

  3. In the Select REST Consumer, select the REST consumer account. You can also create a new REST Consumer by clicking the sign.
  4. Click Save.

Parameters preview

After you have defined the parameters, you can preview them by clicking the  icon on the parameter definition page.