# Global system library functions

Description and characteristics of the global functions of the Automation module that can be used when developing scenarios.

# Branch

  • Category: Flow control

  • Function Type: Impure

  • Description:

    Image

    The function is intended for data flow control. The direction is determined depending on the state of the input bool variable.

    • Inputs

      Name Type Description Parameters
      In Exec Call pin Connection
      Condition bool Takes a value of true/false, according to which the function branches the execution sequence. Connection/control
    • Outputs

      Name Type Description Parameters
      true Exec The sequence is active if the Condition input is true Connection
      false Exec The sequence is active if the Condition input is false Connection

# Switch

  • Category: Flow control

  • Function Type: Impure

  • Description:

    Image

    The function determines the data flow direction, depending on the value of the specified string field received as input.

    • Adding, deleting and configuring exit nodes is implemented through the inspector (panel on the right).

    • When added, the immutable Exec type is set by default. The value of the control is empty.

    • The function accepts only a string and numbers as input.

    • Inputs

      Name Type Description Parameters
      In Exec Call pin Connection
      Value WildCard: string & any numbers The variable whose values the function will use to determine the data flow direction. Connection
    • Outputs

      Name Type Description Parameters
      {Value} Exec The sequence that is executed if the value specified by the user matches the value that came to the Control input. Control/Connection
      Default Exec The sequence to be executed if none of the user-specified values ​​matched the Control input. Connection

# ForEach

  • Category: Loop

  • Function Type: Impure

  • Description:

    Image

    • Takes an array of data as input, looping through each one.
    • At each iteration, returns the element of the array ArrayElement and its index ElementIndex.
    • On each iteration of the loop, the Loop sequence is called.
    • After the loop is interrupted, the Completed sequence is called.

    The pin type is mutually inherited between Array and ArrayElement. The array/single is fixed, only the type is inherited.

    • Inputs

      Name Type Description Parameters
      In Exec Call pin Connection
      Array Wildcard: Any array Accepts any array as input for further work with it. The type of this pin is related to the type of the ArrayElement pin. Connection
    • Outputs

      Name Type Description Parameters
      Loop Exec Sequence called every iteration Connection
      ArrayElement Wildcard: Any single Accepts a data type from an input array or from a connection. The type of this pin is related to the Array pin type. When iterating, outputs an array element. Connection
      ElementIndex Integer Index of the ArrayElement for this iteration Connection
      Completed Exec Sequence called at the end of the loop Connection

# DoWhile

  • Category: Loop

  • Function Type: Impure

  • Description:

    Image

    • A loop that is guaranteed to call the loop sequence at least once.

    • On the next iteration, the value of the incoming boolean condition is checked. If it is true, the loop continues. If not, it stops.

    • After the loop is broken, the Complete sequence is called.

    • Inputs

      Name Type Description Parameters
      In Exec Call pin Connection
      Condition Boolean A value that determines whether the loop continues or does not. Connection/control
    • Outputs

      Name Type Description Parameters
      Loop Exec Calls the sequence while Condition == True. Connection
      Completed Exec Calls the sequence if Condition == False Connection

# WhileDo

  • Category: Loop

  • Function Type: Impure

  • Description:

    Image

    • The function calls the sequence cyclically while the input condition is true.

    • After the loop is broken, the Complete sequence is called.

    • Inputs

      Name Type Description Parameters
      In Exec Call pin Connection
      Condition Boolean A value that determines whether the loop continues or does not. Connection/control
    • Outputs

      Name Type Description Parameters
      Loop Exec Calls the sequence while Condition == True. Connection
      Completed Exec Calls the sequence if Condition == False Connection

# BreakDynamic

  • Category: Structure/object

  • Function Type: Pure

  • Description:

    Image

    The function allows decomposing an arbitrary object into its constituent elements.

    1. An arbitrary object of the Dynamic type is accepted as input. For the output, the user creates pins, sets their types and indicates which expected fields will be included in it.
    2. If such a field exists for the given input object, then its value is passed to the output.
    • Inputs

      Name Type Description Parameters
      Object Wildcard:Dynamic single Accepts any object Connection
    • Outputs

      Name Type Description Parameters
      Customizable Customizable The user can add and configure Pins in the inspector. Pins can be arrays. Connection

# BreakStruct

  • Category: Structure/object

  • Function Type: Pure

  • Description:

    Image

    The function automatically decomposes a structure into its properties when an incoming connection is established.

    Properties of the first level of nesting are reflected as outgoing pins.

    • Inputs

      Name Type Description Parameters
      Value Wildcard:Struct single Accepts any structure Connection
    • Outputs

      Name Type Description Parameters
      - The type and number of pins depend on the composition of the incoming structure Pins are added automatically when an incoming connection is established Connection

# SetMembersInStruct

  • Category: Structure/object

  • Function Type: Impure

  • Description:

    Image

    The function allows you to change values of specific structure properties.

    • The block is created with a selectable structure type.

    • The entire structure is taken as input to the function. In the inspector, the user can specify which structure properties will have their values set.

    • User-selected properties appear as incoming feature pins that can be connected or controlled.

    • At the output of the function, the structure with the changed values ​​will be presented.

    • Inputs

      Name Type Description Parameters
      In Exec Function call pin Connection
      Object Wildcard: Struct single Takes a structure as input Connection
      - - By default, structure property pins will be absent. They need to be specified in the configuration settings in the inspector. Connection/control
    • Outputs

      Name Type Description Parameters
      Out Exec Function call pin Connection
      Result Struct The output will be the specified structure type with the updated values ​​of the specified properties. Connection

# MonqHTTPRequest

  • Category: HTTP Query

  • Function Type: Impure

  • Description:

    Image

    The function allows you to generate an http request to access the public API of the system. To form a request, you will need to specify:

    • API address,
    • request type,
    • request body.

    Inside the function, struct will be converted to JSON to bring it to the desired request format.

    • Inputs

      Name Type Description Parameters
      In Exec Function call pin Connection
      URL string API Address Connection/control
      Type string Request type (method) Connection/control
      Body Wildcard: Struct array/single Request body Connection
      Bearer Token string User token (Automaton bot token) Connection/control
      UserspaceId string Userspace identifier Connection/control
    • Outputs

      Name Type Description Parameters
      Ok Exec Function call pin, in case of successful completion of the request. Connection
      Failed Exec Function call pin, in case of unsuccessful request execution. Connection
      Error string If there is an error, its body will be passed to this outgoing pin. Connection
      Result Wildcard: Struct array/single The request result will be sent to this outgoing pin in the format determined by the established Wildcard. Connection

# ArrayAddElement

  • Category: Array

  • Function Type: Impure

  • Description:

    Image

    The function adds an element to the input array and returns the updated array.

    • Inputs

      Name Type Description Parameters
      In Exec Function call pin Connection
      Array Wildcard: Any array Accepts and modifies an array. Wildcard Pin type is set to all pins. Connection
      Element Wildcard: Any single Takes as input an element to be added to the array. Wildcard Pin type is set to all pins. Connection
    • Outputs

      Name Type Description Parameters
      Out Exec Function call pin Connection
      Result Wildcard: Any array Returns the modified array. Wildcard Pin type is set to all pins. Connection

# ArrayAny

  • Category: Array

  • Function Type: Pure

  • Description:

    Image

    The function takes an array as input and returns true if the array contains at least one element.

    • Inputs

      Name Type Description Parameters
      Array Wildcard: Any array Takes an array as input to check for the presence of elements in it Connection
    • Outputs

      Name Type Description Parameters
      Result bool Returns a value based on the result of the check Connection

# ArrayFirst

  • Category: Array

  • Function Type: Pure

  • Description:

    Image

    The function takes an array as input and returns its first element.

    • Inputs

      Name Type Description Parameters
      Array Wildcard: Any array It takes an array as input. The Wildcard type is set in pairs on the incoming and outgoing pins. Connection
    • Outputs

      Name Type Description Parameters
      Result Wildcard Returns the first element of the array. The Wildcard type is set in pairs on the incoming and outgoing pins. Connection

# ArrayExcept

  • Category: Array

  • Function Type: Pure

  • Description:

    Image

    The function takes two Wildcard arrays as input, returns an array containing all elements of the first array that are not in the second array.

    The type is inherited for all 3 pins when connecting/disconnecting.

    • Inputs

      Name Type Description Parameters
      First Wildcard: Any array Accepts any array, the type is set to all pins of the block, if not already set. Connection
      Second Wildcard: Any array Accepts any array, the type is set to all pins of the block, if not already set. Connection
    • Outputs

      Name Type Description Parameters
      Result Wildcard: Any array Returns an array of elements of the first array that are not in the second array. Connection

# Equal

  • Category: Operators

  • Function Type: Pure

  • Description:

    Image

    The function takes ​​two values A and B as input and compares them, if they are equal it returns true.

    • Values ​​must be of the same type.

    • The type is mutually inherited.

    • Inputs

      Name Type Description Parameters
      A Wildcard: Basic single or struct:DateTime A value to compare Connection/control
      B Wildcard: Basic single or struct:DateTime A value to compare Connection/control
    • Outputs

      Name Type Description Parameters
      Result bool Returns the result of the comparison. Connection

# NotEqual

  • Category: Operators

  • Function Type: Pure

  • Description:

    Image

    The function takes ​​two values A and B as input and compares them, if they are not equal it returns true.

    • Values ​​must be of the same type.

    • The type is mutually inherited.

    • Inputs

      Name Type Description Parameters
      A Wildcard: Basic single or struct:DateTime A value to compare Connection/control
      B Wildcard: Basic single or struct:DateTime A value to compare Connection/control
    • Outputs

      Name Type Description Parameters
      Result bool Returns the result of the comparison. Connection

# Greater

  • Category: Operators

  • Function Type: Pure

  • Description:

    Image

    The function takes two values A and B as input and compares them, if A is greater than B it returns true.

    • Values ​​must be of the same type.

    • The type is mutually inherited.

    • Inputs

      Name Type Description Parameters
      A Wildcard: Basic single or struct:DateTime A value to compare Connection/control
      B Wildcard: Basic single or struct:DateTime A value to compare Connection/control
    • Outputs

      Name Type Description Parameters
      Result bool Returns the result of the comparison. Connection

# GreaterOrEqual

  • Category: Operators

  • Function Type: Pure

  • Description:

    Image

    The function takes two values A and B as input and compares them, if A is greater than or equal to B, it returns true.

    • Values ​​must be of the same type.

    • The type is mutually inherited.

    • Inputs

      Name Type Description Parameters
      A Wildcard: byte, double, integer, integer64, struct:DateTime A value to compare Connection/control
      B Wildcard: byte, double, integer, integer64, struct:DateTime A value to compare Connection/control
    • Outputs

      Name Type Description Parameters
      Result bool Returns the result of the comparison. Connection

# Less

  • Category: Operators

  • Function Type: Pure

  • Description:

    Image

    The function takes two values A and B as input and compares them, if A is less than B, it returns true.

    • Values ​​must be of the same type.

    • The type is mutually inherited.

    • Inputs

      Name Type Description Parameters
      A Wildcard: byte, double, integer, integer64, struct:DateTime A value to compare Connection/control
      B Wildcard: byte, double, integer, integer64, struct:DateTime A value to compare Connection/control
    • Outputs

      Name Type Description Parameters
      Result bool Returns the result of the comparison. Connection

# LessOrEqual

  • Category: Operators

  • Function Type: Pure

  • Description:

    Image

    The function takes two values A and B as input and compares them, if A is less than or equal to B, it returns true.

    • Values ​​must be of the same type.

    • The type is mutually inherited.

    • Inputs

      Name Type Description Parameters
      A Wildcard: byte, double, integer, integer64, struct:DateTime A value to compare Connection/control
      B Wildcard: byte, double, integer, integer64, struct:DateTime A value to compare Connection/control
    • Outputs

      Name Type Description Parameters
      Result bool Returns the result of the comparison. Connection

# Increment

  • Category: Operators

  • Function Type: Impure

  • Description:

    Image

    The function increments by 1 the value of the numeric variable with which it has an incoming connection. The function returns the modified value at the output.

    • Inputs

      Name Type Description Parameters
      In Exec Function call pin Connection
      Value Wildcard: byte, double, integer, integer64 Establishes connection to a variable Connection
    • Outputs

      Name Type Description Parameters
      In Exec Function call pin Connection
      Result Wildcard: byte, double, integer, integer64 Establishes connection to a variable Connection

# Decrement

  • Category: Operators

  • Function Type: Impure

  • Description:

    Image

    The function decrements by 1 the value of the numeric variable with which it has an incoming connection. The function returns the modified value at the output.

    • Inputs

      Name Type Description Parameters
      In Exec Function call pin Connection
      Value Wildcard: byte, double, integer, integer64 Establishes connection to a variable Connection
    • Outputs

      Name Type Description Parameters
      In Exec Function call pin Connection
      Result Wildcard: byte, double, integer, integer64 Establishes connection to a variable Connection

# AND

  • Category: Logic Operators

  • Function Type: Pure

  • Description:

    Image

    A function with two or more operands. The result of the function execution is true if and only if all the input operands are true.

    • User can add an unlimited number of operands through the inspector.

    • For added pins, the default pin type is bool.

    • Default value is false.

    • Inputs

      Name Type Description Parameters
      a bool Takes bool value for comparison Connection/control
      b bool Takes bool value for comparison Connection/control
    • Outputs

      Name Type Description Parameters
      Result bool Execution result Connection

# OR

  • Category: Logic Operators

  • Function Type: Pure

  • Description:

    Image

    A function with two or more operands. The result of the function execution is true when at least one of the input operands is true.

    • User can add an unlimited number of operands through the inspector.

    • For added pins, the default pin type is bool.

    • Default value is false.

    • Inputs

      Name Type Description Parameters
      a bool Takes bool value for comparison Connection/control
      b bool Takes bool value for comparison Connection/control
    • Outputs

      Name Type Description Parameters
      Result bool Execution result Connection

# NOT

  • Category: Logic Operators

  • Function Type: Pure

  • Description:

    Image

    Function with one operand. The result of the function is true if and only if the input operand is false.

    • Inputs

      Name Type Description Parameters
      Value bool Takes a bool value for checking Connection/control
    • Outputs

      Name Type Description Parameters
      Result bool Execution result Connection

# Add

  • Category: Math Operators

  • Function Type: Pure

  • Description:

    Image

    The function takes two or more values ​​as input, adds them up and returns the sum.

    • The user can set the number of incoming pins in the inspector settings.

    • When adding another term, it is set to 0 by default.

    • Inputs

      Name Type Description Parameters
      a Wildcard: byte, double, integer, integer64 Term Connection/control
      b Wildcard: byte, double, integer, integer64 Term Connection/control
    • Outputs

      Name Type Description Parameters
      Result Wildcard: byte, double, integer, integer64 Amount Connection

# StringCreateFrom

  • Category: Strings

  • Function Type: Pure

  • Description:

    Image

    The function accepts any type of data as input, converts it and returns a string as output.

    • Inputs

      Name Type Description Parameters
      Value Wildcard: Any single Accepts any value Connection/control
    • Outputs

      Name Type Description Parameters
      Result string The input value cast to a string Connection

# StringConcat

  • Category: Strings

  • Function Type: Pure

  • Description:

    Image

    The function takes string values ​​as input, concatenates them and returns the resulting string.

    • User can add and remove additional incoming pins through the inspector.

    • When added, the non-editable string type is set by default.

    • Merging of strings occurs in the order of the pins from top to bottom.

    • Inputs

      Name Type Description Parameters
      a string An input string Connection/control
      b string An input string Connection/control
    • Outputs

      Name Type Description Parameters
      Result string Result of concatenation Connection