0

Include Form Parts: Get form-parts meta

  • updated 2 yrs ago

Description

The Get form-parts meta option allows you to include form parts in logicnets as part of the Web Services framework, allowing you to add to the data processing and algorithm functions that were already available in the framework.

Node Type: This part is a call node type.

Used With: This part is for use with the Web Services Framework.

Example

There is an example project that allows you to review this feature. To download this example, go to the Get form-parts meta Example Project.

 

Use

It is important to note that the form parts will not render HTML output as they would in an interactive web application. Instead, the meta-data of the form-parts is available so you can pass it back to the webservice client. To get this data, you use the Get form-parts meta function from the special option in the Designer menu.

 

This function loads into a data object the meta information of the form parts included in your logicnets, and you can include that data object in your output. The system exports the following meta-information of form parts:

  • caption: This is the title of the form part.
  • path: This is the path/name of the data object in which the user input is stored. 
  • data_type: This is the expected data type.
  • form_part_type: This is the form part type.
  • options: For dropdown, checklist, or radio form parts, this lists the choices in caption/value pairs.
  • on/off: For checkbox form parts, this is the value associated with the check/uncheck.
  • validation_rules: If a form part has validation rules, this is where the the rules are exported (type, rule, and validation message).
  • validation_error: This indicates any validation errors. It is 0 if there are no errors and 1 if there are errors. It is only available when there are validation rules associated with the part.
  • validation_message: If there is a validation error, this is the message associated with it.
  • references: If a form part includes references to a resource, this is where the reference is exported (description, url, guid, name, path).

Data Export Sample

The following is a sample of the export of the form parts:


  {

      "caption": "Text input",

      "data_type": "text",

      "path": "text_input",

      "form_part_type": "text_input"

  }, {

      "caption": "Number input",

      "data_type": "number",

      "path": "number_input",

      "form_part_type": "text_input"

  }, {

      "min": 0,

      "data_type": "number",

      "max": 100,

      "path": "slider_input",

      "caption": "Slider input",

      "form_part_type": "slider"

  }, {

      "data_type": "date",

      "caption": "Date input",

      "path": "date_input",

      "form_part_type": "datetime_input"

  }, {

      "data_type": "text",

      "path": "check_box",

      "caption": "Check box",

      "on": "checked",

      "off": "unchecked",

      "form_part_type": "checkbox"

  }, {

      "options": [{

              "caption": "A",

              "value": "a"

          },

          {

              "caption": "B",

              "value": "b"

          }

      ],

      "path": "radio_list",

      "data_type": "text",

      "caption": "Radio list",

      "form_part_type": "radio"

  }, {

      "options": [{

              "caption": "A",

              "value": "a"

          },

          {

              "caption": "B",

              "value": "b"

          }

      ],

      "path": "check_list",

      "data_type": "collection",

      "caption": "Check list",

      "form_part_type": "checklist"

  }, {

      "data_type": "text",

      "options": [{

              "caption": "A",

              "value": "a"

          },

          {

              "caption": "B",

              "value": "b"

          }

      ],

      "path": "drop_down",

      "form_part_type": "dropdown",

      "caption": "Drop down"

  }, {

      "caption": "Hello world!",

      "form_part_type": "comment"

  }, {

      "references": [{

              "description": "Logicnets",

              "url": "https:\/\/support.logicnets.com",

              "guid": "084790D4-AACE-79B2-520C-8D1154DF1202",

              "name": "Logicnets"

          },

          {

              "path": "<div>Hello hello<\/div>",

              "guid": "source1-workspace\/demo\/projects\/EAFB450434764F510C1224873C52F204-1-",

              "name": "hello hello"

          }

      ],

      "form_part_type": "show_references"

  }

   

Validation Rules:


  {

      "path": "text_input_1",

      "data_type": "text",

      "caption": "Text input 1",

      "form_part_type": "text_input",

      "validation_message": "Please fill in a name",

      "validation_error": 1,

      "validation_rules": [{

          "type": "mandatory",

          "rule": "",

          "message": "Please fill in a name"

      }]

  }, {

      "caption": "Text input 2",

      "validation_message": "Value must be 'hello'",

      "data_type": "text",

      "path": "text_input_2",

      "validation_error": 1,

      "validation_rules": [{

          "type": "custom (always)",

          "rule": "':val' == 'hello'",

          "message": "Value must be 'hello'"

      }],

      "form_part_type": "text_input"

  }

   
Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like Follow
  • 2 yrs agoLast active
  • 20Views
  • 1 Following

Home