Adding conditions to a map
Use conditions to dynamically manage field links based on data values or processing logic.
Before you begin
- Log in to your tenant.
- Create the flow service as described in the About this task section.
About this task
Create a flow service named CentimetertoMeterConversion, which converts
input values from centimeters to meters. If the result is zero meters, a custom
message is logged.
The flow service includes.
- Service. Math.multiplyFloats
- Runs a multiplication operation between two floating-point numbers.
- Service Input
num1. Receives the input value from the pipeline. For example, centimeters.num2. A constant conversion factor set to 0.01 (used to convert centimeters to meters).- Service Output
- Value. The result of multiplying
num1bynum2, representing the converted value in meters. - Pipeline Input
- centimeters. The original value to be converted.
minValue. A threshold value used to determine whether conversion proceeds.
maxValue. A limit used in conditional logic.
default. A fallback value is used when minValue is a certain threshold.
- Pipeline Output
- meters. The final converted value in metersis, which is derived from the service output.
- Conditional Step
- If the meters value is equal to
zero, a custom message is logged to indicate that the conversion result iszero. Modify the logic of the flow service such that it converts only specific values instead of all values based on the conditions.num1 = minValue > 1 and maxValue < 9999default = minValue < 1