Skip to content

Transformer

This module contains step implementations for the Transformer task.

Then transform

Then parse "{content}" as "{content_type:ContentType}" and save value of "{expression}" in variable "{variable}"

[view_source]

Create an instance of the Transformer task.

Transforms the specified content with content_type to an object that an transformer can extract information from with the specified expression.

See Transformer task documentation for more information about the task.

Example:

And value for variable "document_id" is "None"
And value for variable "document_title" is "None"
And value for variable "document" is "{"document": {"id": "DOCUMENT_8843-1", "title": "TPM Report 2021"}}"
...
Then parse "{{ document }}" as "json" and save value of "$.document.id" in variable "document_id"
Then parse "{{ document }}" as "json" and save value of "$.document.title" in variable "document_title"

Arguments:

  • contents str - contents to parse, supports Templating or a static string
  • content_type TransformerContentType - MIME type of contents
  • expression str - JSON or XPath expression for specific value in contents
  • variable str - name of variable to save value to, must have been initialized