Actions
Actions are embedded hyperlinks to either external resources or Forms
Actions for Links
Example:
- name: vacations
group: Demo
caption: Vacations
type: list
description: |
Ãœbersicht der Urlaube
formId: create_vacation
icon: 'edit'
actions:
- label: 'Edit vacation' # Handlebar
key: 'edit_vacation'
type: 'FORM' # [LINK, FORM ]
condition:
- expression: "{{eq VACATION_EMAIL PORTRAIT_USER_EMAIL}}"
forwardFields:
- key
- VACATION_EMAIL
- VACATION_DATE
- VACATION_STATUS
So all Entries of src-inventory
have the same configured actions available. However not all actions are displayed equally. For example inventory items that are not in stock (amount <= 0) the link is not displayed. In addition, the value of the link is also different for each inventory item
Actions for triggering Forms
I am logged in as user linda.jackson and therfore are only allowed to open the edit vacation form assigned to this user.
Example
actions:
- label: 'Edit vacation' # Handlebar
key: 'action1'
value: 'create_vacation'
type: 'FORM' # [LINK, FORM ]
condition:
- expression: "{{eq VACATION_EMAIL PORTRAIT_USER_EMAIL}}"
forwardFields:
- key
- VACATION_EMAIL
- VACATION_DATE
- VACATION_STATUS
Please also make sure to also apply the condition to the form itself for maximum security! see Post Processing (onSubmit) | Conditions
Properties
Attribute | Examples | Description | Default | Handlebar support |
---|---|---|---|---|
type | either
|
|
|
|
key |
| unique string value unique action name for this section | required |
|
label |
| label for the embedded link | required |
|
value |
| Either the displayed value for in case of or the id for the form you want to referece in case of type | '' (blank) |
|
icon |
| displayed icon for the embedded link |
|
|
condition | condition:
- expression: "{{gt Amount 0}}"
- expression: "{{eq VACATION_EMAIL PORTRAIT_USER_EMAIL}}" | Decides if the action is available for this entry. Available Parameters see For more details see https://portrait.atlassian.net/wiki/x/AYDHPg (the errorMessage is only logged here and not passed to the user) |
(so always true) |
|
Â
Â
Â
Â
Â