Skip to main content

Node - Operation


Node Function: New results are calculated by this node for use by subsequent nodes; the node itself does not directly modify the value of the field.

Differences from formula control in worksheet:

  • The operation node can perform cross-table and cross-record calculations, and the fields involved in the calculation can be field values from different records; the worksheet formula control can only calculate fields within this table.

  • The operation node is to edit the field and save it to perform the calculation through the workflow, while the formula control is to calculate the result directly when editing the field, the timeliness is different.

Supported types of operations:

  • Numerical operation: Mathematical calculations between values and amounts
  • Duration: Calculation of hours between two days
  • Time plus/minus at a date: Add or subtract hours to a date to get a new date
  • Totalize the number of records: Count the total number of records queried by the "Bulk Data Node"
  • Function calculation: Data processing by functions

How to save the calculation results:

  • Direct calculation

    Calculates directly when executing to an operation node and saves the result for use by subsequent nodes.

  • Dynamic calculation

    Recalculate each time the execution reaches the node that uses the result of the operation, and the result may be different for different nodes.

I. Numerical operation

Numerical values and amounts are calculated by arithmetic nodes, usually used for calculations between fields of different records, for example, when a product is warehoused, the inventory of the product needs to be updated, and the latest inventory amount is the sum of the incoming amount (incoming detail table record) and the existing inventory amount (inventory table).

Configuration

1. Add the operation node, select the value operation

2. Set the calculation formula

Just select the fields involved in the calculation to the fill box.

Tips

  • The decimal point is reserved 2 digits by default (rounded).
  • The value/amount field is calculated according to 0 if the value is empty.
  • When using the system formula, the fields inside the brackets are separated by a comma "," when writing your own formula, you must fill in the operation in line with (+_*/).
  • Add a formula to support the search formula function, when entering letters will detect the corresponding formula letters, display the search results.
  • field does not exist or has been deleted, the field value is empty, you can carry out operations, if an exception occurs, according to the process failure to deal with, such as: division 5 / 0.

3. The node behind the use of arithmetic results

The latter nodes need to use the operation node, directly refer to this node can be.

2. Time plus/minus at a date

  • A: Select a date field, add or subtract for the date of this field.

  • B: Set the format of the date to participate in the calculation: date format, date + time format.

    • Date format calculation: for example, the incoming date is 2021-11-11 12:50, the participating calculation is 2021-11-11.

    • Date + time format, then the format involved in the calculation is 2021-11-11 12:50

  • C: the operation formula, as configured in the figure, the operation result is directly for the date to add 9 hours

Tips:

  • The first formula must be calculated symbol (+/-).
  • Y/M/d represents the year / month / day, h represents the hour, m represents the minute. M and m are case-sensitive.
  • The number must be preceded by a calculation symbol (+/-) and followed by a unit (Y/M/d/h/m) e.g. +8h+1m.
  • The numeric field must be followed by the unit (Y/M/d/h/m).
  • After selecting the numeric field of other nodes, write the date unit directly without any symbol in between. For example.

Example 1: Operational format is date

Date passed in: 2020-10-12 13:50
operation format: date.
Operation formula: +7d+3h-2m

The date of the operation is 2020-10-12 00:00, adding 7 days, 3 hours and subtracting 2 minutes.

The result is: 2020-10-19 02:48

Example 2: The format of the operation is date + time

Date passed in: 2020-10-12 13:50
Operation format: date + time
Operation formula: +3h

Operation result: 2020-10-12 16:50

Example 3: Get the day's 8 o'clock

The following figure, pass in the current time of the system, the execution to the current node is 2020-12-21 14:37. The format of the operation is: date, the date involved in the operation is 2020-12-21 00:00. The formula for the operation is +8h, that is, an increase of 8 hours, to get 2020-12-21 08:00

3. Duration

The same method as the formula control to calculate the duration of the day period, first specify the fields corresponding to the start date and the end date, and then set the format of the two day periods involved in the calculation.

  • Format 1: Start Date 0:00,End Date 24:00

  • Format 2: Start date 0:00,End date 00:00

Formatting only works for dates without a time part, if it contains a time part, it participates in the calculation by the actual time.

Example 1

Start time 2020-12-13 , end time 2020-12-14 ,input out unit: days

  • If format 1 is selected, the actual calculation is done for the hours 2020-12-13 00:00 and 2020-12-14 24:00, and the result is 2 days.

  • If format 2 is selected, the actual calculation is done for the hours 2020-12-13 00:00 and 2020-12-14 00:00, and the result is 1 day.

Example 2

Start time 2020-12-13, end time 2020-12-14 12:00, output unit: hours

  • If format 1 is selected, the actual operation is done for the hours of 2020-12-13 00:00 and 2020-12-14 12:00, and the result is obtained in 36 hours.

  • If format 2 is selected, the actual operation will be done for the hours 2020-12-13 00:00 and 2020-12-14 12:00, and the result will still be 36 hours. Because the end time has a time part, calculated by the actual time, this field will not be formatted, only the start date.

4. Totalize the number of records

Because of the delay in the statistics of the summary field, it may not be accurate to get the number of rows of associated records by the summary field. Then you can use this operation to get the number of rows of associated records.

    1. First, use the "Get multiple piexes of data" node to get the eligible data.
    1. Get the number of rows of data by this node.

Sometimes, it may be necessary to do different branches according to the number of rows, then you can combine the branch node.

Note: The "Get multiple pieces of data" node itself will query all the records that match the criteria. If the operator node counts the number of rows of data it fetches, it will count all the rows that meet the query criteria, even if the fetch multiple data node is set to fetch at most XX rows will be ignored.

5. Function calculation

Through the function, you can process the value of the text, numeric, date and other process node objects, such as.

  • Using the YEAR () function, to obtain the year of the date
  • The use of REPLACE () function, the cell phone number in the + 86 to remove
  • Use the DISTANCE() function, calculate the distance between two positioning fields.

Example: Example of the function operation node to remove the +86 from the cell phone number

Introduction to the function


Have questions about this article? Send us feedback