Przejdź do treści

Automation

Value steps

Value steps calculate things in a workflow, from fixed values and comparisons to math, text, dates, lists, conversions, and locations.

Ta strona nie została jeszcze przetłumaczona. Czytasz oryginał.

Value steps calculate something: a sum, a formatted date, a subject line, a yes-or-no answer. They don't have a place in the run order. Each is worked out the moment a later step needs its result. Connect their outputs to the inputs of other steps.

Fixed values#

String, Number, Boolean, Date Literal, Object, and Array hold a value you type in. Use them for constants, such as a fixed email address or a threshold amount.

Structured values#

StepWhat it does
Make StructBuilds a structured value from named fields that you define.
Break StructSplits a structured value back into its fields.
Make EnumPicks one label from a fixed set you define, such as low, medium, or high. Use it with Switch Enum.
Make ArrayBuilds a list from separate inputs.

Comparisons and logic#

  • Compare two values with Equal, Not Equal, Greater Than, Less Than, Greater or Equal, and Less or Equal.
  • Combine yes-or-no values with And, Or, and Not.

Connect the result to a Branch step to choose a path.

Math#

Add, Subtract, Multiply, Divide, Modulo, Power, Min, Max, Clamp, Abs, Floor, Ceil, and Round.

Dividing by zero gives an empty result rather than an error, so check for it if it can happen.

Text#

GroupSteps
Join and measureConcat, Length, Template
Case and spacingUpper Case, Lower Case, Trim, Remove Whitespace, Pad Start, Pad End
SearchContains, Starts With, Ends With, Index Of
Cut and replaceSlice, Split, Replace, Replace All
PatternsRegex Test, Regex Match, Regex Replace
EncodingBase64 Encode, Base64 Decode, URL Encode, URL Decode, Hash
GenerateRandom String

Template fills placeholders in a piece of text with values, which is the easiest way to build an email subject or a reference code. Use the pattern steps when the format really is a pattern, such as a customer-specific code. To check a whole input against a known shape, Validate Schema is usually simpler.

Conversion#

StepWhat it does
To StringTurns any value into text.
To NumberTurns text into a number. Gives an empty result if it can't.
To BooleanTurns a value into yes or no. Empty text, zero, and empty values become no.
JSON ParseReads JSON text into a value, such as the body of an HTTP response.
JSON StringifyTurns a value into JSON text.

Dates and times#

GroupSteps
CreateNow, Date Literal, Parse Date, Date From Parts, From Unix, From Unix (ms)
FormatFormat Date, To Unix, To Unix (ms), To Timezone
PartsYear, Month, Day, Day of Week, Hour, Minute, Second
CalculateAdd, Subtract, Diff, Start Of, End Of
CompareBefore, After, Equal

For example, use Add with 30 days for a due date, Start Of with "day" for midnight, and Diff to count the days between two dates. Format Date uses a pattern such as %d.%m.%Y and can convert to a time zone first, such as Europe/Berlin.

Lists#

GroupSteps
ReadGet Element, Array Length, Array Includes, Array Find, Array Find Index
ChangeArray Push, Array Pop, Array Reverse, Array Slice, Array Concat, Array Sort, Array Distinct
TotalsArray Sum, Array Average, Array Min, Array Max
ReshapeArray Map, Array Filter, Array Group By

Array Map picks one field from every item, such as all customer IDs. Array Group By groups items by a field, such as invoices by customer. Get Element with -1 returns the last item.

Locations#

These work with the same points as a Location column.

GroupSteps
Create and readMake Geo Point, Break Geo Point, Geo Point From String, Geo Point To String, Format Geo Point
MeasureDistance, Bearing, Destination, Midpoint
CheckWithin Radius, In Bounds
Many pointsCentroid, Bounds, Nearest, Sort By Distance

For example, use Nearest to find the closest depot to a customer, or Within Radius to check whether an address is inside your service area. To turn a street address into a point, use Geocode Address, described in Other systems.

Keep it simple#

You rarely need to plan every calculation step. Describe the result, such as "the subject is the order number and customer name", and build it with the steps above. Spell out a calculation only when it's a business rule in its own right, such as how a discount is worked out.

Masz problem albo czegoś brakuje? Zapytaj społeczność.

Zapytaj społeczność

Wyświetl jako MarkdownZaproponuj poprawkę