Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Next »

Licenses

COMMUNITY, ENTERPRISE, CORPORATE

Since

VERSION 6.0

Form fields for trigger forms

Form fields of a Trigger-Forms are determined by the respective schema defined for your app. The type inside a JSON schema defines the data format of a field. Furthermore based on this type, form fields are rendered automatically in order to fit the defined format. The supported format types are listed in the section Schema - Types .

To create a trigger form you have to create a schema and afterwards create the form as a new property. How to do this is described here: Tutorial: Create a new form . In the form you can just refer to your schema. All fields and types (including file upload functionality) will be taken over from the schema. See example of form description below:

{
  "title": "person",
  "description": "",
  "schema": "property.list?filter=global/app/MY_App/object/person/v1/schema",
  "output": "global/app/MY_APP/object/person/v1/instance/%23%7Bvar.property.uuid%7D"
}

Form fields for task forms

When working with task forms via the Online-Workflow-Modeler you can select the form type directly from a dropdown list. In this list there are the same options as for schema.

Static drop down values for form fields

In case you want to show in a field of a trigger form a dropdown list you have the following options:

  1. Refer to a fix list with any values

  2. Refer to a group of users from IAM

Fix list of entries

To refer to a fix list of entries, you have to define enum in schema.

"account": {
      "title": "Kostenstelle *",
      "type": "string",
      "enum": [
        "1000",
        "1100",
        "1200",
        "2000",
        "2100"
      ]
    }

Group of users in IAM

to refer to a group of user you have to…

In schema.

"user": {
      "type": "string",
      "title": "User",
      "enum": []
    }

In form definition then:

{
  "field": "user",
  "visibleColumns": [
    "username"
  ],
  "values": "pipeline:iam.group.members?name=Employee (Standard)"
}

Dynamic drop down values for form fields

In case you want to filter values in a dropdown list based on specific entries in the form you have to…

Example

When a specific value for budget is exceeded, the list of potential reviewer is directly filtered to members of a specific group in IAM.

Can sign > 10k

Can sign <10k

All members of group “C-Level”

All members of group “Department Head”

In schema:

"user": {
  "type": "string",
  "title": "User",
  "enum": []
},
"canSign": {
  "type": "number",
  "title": "Can sign"
}

In form definition:

{
  "title": "f1",
  "description": "",
  "schema": "property.list?filter=global/app/a1/object/f1/v1/schema",
  "output": "global/app/a1/object/f1/v1/instance/%23%7Bvar.property.uuid%7D",
  "script": {
    "onblur": "var response; if (form.canSign > 10000) { response = await pi.pipeline('iam.group.members?name=C-Level') } else { response = await pi.pipeline('iam.group.members?name=Department Head') }; if (response) { schema.properties.user.enum = response }"
  },
  "layout": {
    "orientation": "vertical",
    "items": [
      {
        "field": "user",
        "visibleColumns": [
          "username"
        ]
      },
      {
        "field": "canSign"
      }
    ]
  }
}

Dynamic calculation of values in a form

You have the option to show calculated values in a trigger form. To do so you have to…

In schema:

"value1": {
  "type": "number",
  "title": "value1"
},
"value2": {
  "type": "number",
  "title": "value2"
},
"value3": {
  "type": "number",
  "title": "value3"
}

In form definition:

{
  "title": "f1",
  "description": "",
  "schema": "property.list?filter=global/app/a1/object/f1/v1/schema",
  "output": "global/app/a1/object/f1/v1/instance/%23%7Bvar.property.uuid%7D",
  "script": {
    "onblur": "form.value3 = form.value1 + form.value2"
  },
  "layout": {
    "orientation": "vertical",
    "items": [
      {
        "field": "value1"
      },
      {
        "field": "value2"
      },
      {
        "field": "value3",
        "readonly": true
      }
    ]
  }
}

Add attachments in a task form

You have the option to upload a file with a task form as well. To do so you have to…

TODO - Simon

Show attachments in a task form

You have the option to show an uploaded file of a trigger form in an task form. To do so you have to…

TODO - Simon

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.