Skip to main content
Using the Parameter Editor

How to configure Tasks and reference their results.

Ossi Galkin avatar
Written by Ossi Galkin
Updated over a year ago

When building Frends Processes and Subprocesses, you will need to configure Tasks to define exactly what they should do. An example of this kind of configuration could be configuring the SQL query that an SQL Task should execute.

The configuration of these Tasks is done using the Parameter Editor, which appears on the right side of the Process Editor when selecting a Task from the Canvas.

Configuring Element Basic Properties

When configuring Tasks using the Parameter Editor, you should start with the basic properties.

Name

Many Elements have a name input. Elements with return values generally require a name. The Element name is used when referencing the result of a previous Element, and therefore, the Element name must be unique within a Process.

Type

For Elements of type Start, Task, and Call Subprocess, a type selection must be made. Clicking on the type selector dropdown will show a list of available types. After selecting a type, the parameters associated with it will be displayed. The Task return type and package can be seen by hovering over a selected type.

Description

Each Element also has an optional description field where you can enter freeform information or documentation about the operation the Task is performing. This is a good place to store, for example, contact information of a specific system holder if there is a problem executing the Task.

Retry on failure

Tasks can have automatic retries.

Dispose at the end of the scope

When activated, the result object will be disposed at the end of the current scope.

Entering Element Specific Properties

For each property, you will be provided with the field for the property input and a label describing what the input should be for each property. This description label can also be hovered over with a mouse to reveal additional information on how to correctly configure the said property.

Parameter Input Modes

When entering the input for a parameter, you will be given the option to specify what kind of data you are giving as an input using the input type selector.

Text Input Mode

When using the text input mode, you can enter freeform text as your given input. This input can be modified using the standardized {{ handlebar }} notation of Frends. Inside the handlebars, it is allowed to write C# code. For example, one could give a file name with the current day in the format:

file_{{DateTime.Now.ToString("yyyyMMdd")}}.xml

Which would result in an input of, for example, file_20230426.xml.

XML Input Mode

The XML input mode allows you to enter valid XML as the input instead of freeform text. The advantage of this is that it provides on-the-fly validation of the given XML and allows for easier editing of the formatted data. The XML input mode can also be modified using the standardized {{ handlebar }} notation. For example, you could inject the current date into a structured XML with the following input:

<note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
  <date>{{DateTime.Now.ToString()}}</date>
</note>

Which would result in an XML input of:

<note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
  <date>2023-04-26T12:00:00.000Z</date>
</note>

JSON Input Mode

The JSON input mode works the same way as the XML input mode, in that you can enter structured JSON data that can be modified by injecting dynamic data using the {{ handlebar }} notation.

SQL Input Mode

As with the JSON and XML input modes, the SQL input mode allows you to enter structured SQL as an input, which can then be modified using the {{ handlebar }} notation.

Expression Editor Input Mode

The Expression Editor input mode gives you full control over the input you are giving to a specific Task. This means that you can enter C# code in the Expression Editor to convert other incoming dynamic data to a format that is supported by the Task. The {{ handlebar }} notation does not work with the Expression Editor, but you can instead access all of the Process-related variables straight in the Editor without the handlebars.

Adding Results of Previous Tasks as Input

When building integration flows, it's often necessary to pass data between two Frends Elements and Tasks, for example, to first retrieve data from a database and then send that data to a web service. This can be done using the #hashtag notation, which provides all the available references to your current input field, allowed inside handlebars. This means that you can pass the result of a previous Task as input to a different Task, for example.

These results from previous Tasks and other variables can be freely combined to create a desired result. For example, you could create a JSON document that combines data from two previous Tasks with the input:

{
  "note": {
    "to": "Tove",
    "from": "Jani",
    "heading": "{{#result[GetHeading]}}",
    "body": "{{#result[GetBody]}}",
    "date": "{{DateTime.Now.ToString()}}"
  }
}

Using other References as input

Besides the {{ handlebar }} notation and the results of previous Tasks, you can also access various other references relating to the Process with the #hashtag notation. These include:

  • #process - Dynamic information about the execution of the Process.

  • #trigger - Dynamic information and parameters for the Trigger that started the Process. This can be used, for example, to access the REST request properties that started the Process. For details on the available references, please see the individual Trigger reference, e.g., on HTTP Trigger.

  • #env - Access to the Environment Variable values for the current Environment.

  • #var - All available variables in the current Process scope, for example, those initialized by the Code Element.

Search and replace within the Parameter Editor

You can search and replace text in fields by pressing Ctrl+F when the cursor is focused in the field.

Did this answer your question?