helper.transform

Creates a new array by transforming each of the elements in the original array.

For example, you can convert an array of image links to view.image components to display these images. This may be useful if the number of images in the array is unknown in advance.

View example

Component properties

NameTypeDescription
type*"helper.transform"Set component type.
intoanyTemplate to transform elements in the array. The array value can be substituted using the data.local component. To do this, use the construction { "type": "data.local", "path": "item"}. Learn more.
itemsarray

The array that you want to convert. You can specify an array in three ways:

  • Specify the array itself. Example: ["one", "two", "three"].
  • Insert a reference to data (input, output, or internal). Example: {"type": "data.input", "path": "path.to.data"}.
  • Use a reference to another configuration element. Example: {"$ref": "vars.myarray"}.
items[]anyArray element. This can be any element — strings, numbers, JSON objects, or other arrays.

If you used a reference to a field with input data, you do not need to also specify the element.
Contact support

Last updated: March 29, 2023

Introduction
Getting started
Important tips
Useful recommendations
Working with Toloka
Projects
Pools
Tasks
Results
Project analysis
Toloka settings
Task interface
Template Builder
HTML/CSS/JS editor
Help and support
FAQTroubleshootingSupportGlossary