Text
Overview
- The text component allows people to enter simple text data
No Code set up options using the side panel
- Example of the No Code set up side panel
General
Property | Description |
Title | Name of the component. |
Placeholder | The placeholder text can prompt users on how to interact with the component while it's empty. |
Required | When enabled, a red asterisk will appear next to the component name, indicating that the user must enter a value before submitting the task. |
Advanced
Property | Description |
Default data | Automatically populate the component data from a variety of sources. For more information about the default data options available, please refer to the sections 'From this Workflow,' 'Asset Property,' 'Custom Data,' and 'Calculation' below. |
From this Workflow | Note: this is a default data option
Choose a component that, when its value is entered, will populate this component.
You can only select components that are in the current or previous tasks. You can also only select components that are the same type as this component.
When the linked component has data entered into it, the data will also populate this component. |
Asset property | Note: this is a default data option
Choose an asset search component that, when an asset is selected, the relevant asset property will populate this component.
You can only link to asset search components that are in the current or previous tasks. You can only select properties from the selected asset type that are the same type as this component.
When the linked asset search component has an asset selected, the data from the relevant property within the selected asset will populate this component. |
Custom data | Note: this is a default data option
Custom data allows you to set your own custom value.
After selecting the custom data option, you can enter a value into the component within the workflow builder interface. |
Calculation | Note: this is a default data option
The Calculation feature looks at other components in the workflow and does calculations with them.
You can reference a component by putting its data path in curly brackets {}.
To find a data path for a specific component:
1. Open your browser's developer tools.
2. Go to the network tab and refresh the page.
3. Check out the response to the https://api.idiana.io/api/flow/{guid}?v=latest.
4. Find the component under "layoutProperties."
5. Find the component you need by matching the "displayName" in the response to your component's title.
6. Once you've found the component you want, grab the data path from the "dataPath" property (no quotes needed).
Remember, the data path depends on the current task, section, and component names. If those change, update the data path in your calculation.
Calculations:
- Operators: You've got all the usual ones (+, -, *, /, ^, %), plus more listed here: https://mathjs.org/docs/expressions/syntax.html.
- Functions: The Calculation feature also supports any functions from math.js. Check out https://mathjs.org/ for more details. Note: If you're using math.mean(), just type =mean() in the calculation field, not =mean.mean().
Examples:
Want to add two numbers with an operator?
={task.section.componentOne} + {task.section.componentTwo}
Need to find the mean using a math.js function?
=mean({task.section.componentOne}, {task.section.componentTwo}) |
Read only | When enabled, users can’t edit with this component from within a work item. |
Advanced Editor set up options
Properties shared between components
Property | What does the property do (in plain english) | Possible values | How to find these values (in plain english) |
label | The title or label to be displayed | “My Component” | |
dataPath | The data path where to save the value. ex.: “$.hello.world” would result to: { hello: { world: [] } } | “$.task.section.myComponent” | A string that starts with $ for the root, and each step is separated by a dot . . A step is a string without any space. |
isRequired | A flag if component is required to be filled before complete | true | |
isReadOnly | A flag if component is read-only or not editable | false | |
isHidden | A flag if component is hidden | false | |
condition | Hides component if condition not met | "’{$.order.product[0].qty}’ > 10000” or
”’{$.task.section.componentName}’ == ‘value’” | Can either be <, >, or ==
A calculation expression that can use arithmetic operators, but this time, prefix = is not necessary |
onChange | url to be called when component value changed | "/api/v3/flow/execute/activity/{$.id}?refreshLayout=true" | Use the exact value in the example here.
Any Diana API url path in swagger that are GET methods. a variable can be used by wrapping it with {} in the example case it has {$.id} it resolves to the id of work |
width | The with size of component | “col-1”
“col-2”
“col-3”
“col-4”
“col-5”
“col-6”
“col-7”
“col-8”
“col-9”
“col-10”
“col-11”
“col-12” | A string that starts with “col-” followed by a number from 1 to 12. e.g. 12 means it takes up 100% of the horizontal space, and 6 means it takes up half the horizontal space, etc) |
defaultValue | The default value of the component | “{$.task.componentTwo}” (this has the value from Component Two show in this component)
”Hello World” (this shows the text “Hello World” in this component)
”={$.task.num1}+{$.task.num2}” (this shows the sum of the two number components in this component)
”={$.task.firstName} {$.task.lastName} (this concatenated two strings together and shows the first name, then a space, then the second name in this component. Note: You should also set the default value for the first and last name components to equal “ “. Notice that there is a space between the two quotation marks. This is necessary so that the full name component appears to be empty until values are entered into the first and last name components.) | - Can be a literal string value like for text input component. For example, putting “Hello World”, will make it as default value of the text input
- Can be a data path from other components, with this setup it will copy the value of other component.
- Can be a calculation using arithmetic operators. The data path of other components like number input can be used as variable, but they need to be wrapped by {} for example, to add 10 to the value of a data path, it would be ={$.num1}+10 . to activate calculation, it should start with =
- Can be any math.js function. See https://mathjs.org/ for a list of functions |
validation | A list of validation rules | [
{
"type": "error",
"message": "This field is required",
"rules": "required",
"alwaysTrigger": false
}
] | See the “Validation property set up” drop down below this table |
dataKey | To which the value of datapath will be resolved. | “data”
”layoutComponent" | “data” - means the data path will be resolved from work.data
”layoutComponent” - means the data path will be resolved from the layout component config. Ex. $.properties.label will result to the label of component |
defaultValueDataKey | Same with DataKey , but this time it’s for the default value of component | “data”
”layoutComponent" | Check DataKey above |
recalculateDefaultValueWhenDataPathChange | recalculates component value using
defaultData whenever a value changed in the list | [
"={$.num1}+{$.num2}"
] | The values can either be a data path or calculation, like the values that being set in default value |
sidePanelShowHide | Sometimes a work is being rendered in a side panel, but this is mostly common for the assets. This serves as a flag if the component should be shown in case work or asset is rendered in side panel | false | |
name | A unique name that is used by the backend; Not displayed in component but it needs to have a value and must be unique | “my-component” | |
description | Description for the component |
‣
Properties unique to this component
- All of these unique properties sit within a “properties” object e.g.
{
"property one shared between components": "",
"property two shared between components": "",
"property etc shared between components": "",
"properties": {
"Tooltip": "",
"Placeholder": "",
"etc": "",
}
}
Property | What does the property do (in plain english) | Possible values | How to find these values (in plain english) |
tooltip | tool tip is a small icon that shows up at the top of the component name, tooltip can be hovered and you can put hints or guidelines for users for the specific component that uses the tool tip. | tooltip = “tooltip can be hovered to display a sentence or paragraph descriptive of the specific usage of a component” | Create a helpful sentence or short paragraph explaining the component's use. This text will appear when users hover over the tooltip icon. |
placeholder | The text that appears before any value is put on a component. This can be a hint or guide on what to put on the component. this will disappear once you enter a value in component. | Simple description on what value you should put on the component, can be a hint or a guide text phrase. | Think of a short text that helps users understand what to enter in the component. This is usually a brief instruction or example. |
inputType | Defines what type of input this component takes
Note that number components are technically just text components that have their inputType changed to “number | Can either be “text”, “number”, “password”, or “link” | |
dataSource | For regular use this should stay as the default value of “Work” | “Work” |
Advanced Editor example of a set up text input component
{
"name": "taskOneTaskOneText",
"label": "Text",
"description": "",
"defaultValue": "",
"dataPath": "$.taskOne.taskOne.text",
"isRequired": false,
"isReadOnly": false,
"isHidden": false,
"width": "col-6",
"condition": "",
"validation": [],
"properties": {
"inputType": "text",
"placeholder": "example placeholder",
"tooltip": "exampel tooltip",
"dataSource": "Work"
}
}