Skip to content

Format in action form


Formating can help users to transform data to fit their needs. For example, transform a date, remove unwanted characters such as € in a price or getting a value stored in an attribute. Some format are built-in to avoid code.

Note

Generally, a format applies to an element. But it can be applied to anything. Each prebuilt functions can be modified if needed.

Template

One of the most powerful format. It can be used to return simple strings, but can also retrieve context variables. Some examples:

🔹What ever you want: returns string "What ever you want".

🔹${job.name}: returns job's name

🔹${context.currentValue}: element currentValue (trackField for example).

🔹${context.index}: get current index. When selector point on multiple elements, you can use it as an incremental variable.

🔹${context.maxIndex}: the max number of iteration of action.

🔹${context.parent }: context of parent. null if depth is 0.

🔹${context.parent.index}: When in a loop, you can get value of current iteration.

🔹${context.count}: number of element found by action.

🔹${context.continue}: if next iteration should stop or not.

🔹${context.depth}: position of action in parent/child action tree.

🔹${parameters.YOUR_PARAMETER}: can be used to retrieve a job parameter value according to key name.

Note

You can combine multiple values and/or strings: ${job.name} any string ${context.index} could lead to "MyJob any string 3".

Example

we want to get a price from a field, we can format it as template, writing : ${ context.currentValue.replace(" € VAT", "") }

Custom

🔹this.element : current element, if any is set with locator in action form.

🔹this.context : current action context

  • this.context.currentValue : element currentValue (trackField for example)
  • this.context.index : current position in loops
  • this.context.maxIndex : the max number of iteration of action
  • this.context.count : number of element found by action
  • this.context.continue : if next iteration should stop or not
  • this.context.depth : position of action in parent/child action tree
  • this.context.parent : context of parent. null if depth is 0

🔹Use predifined functions to help you