skip to Main Content

The Formatter Action

Built into Uncanny Automator rather than being an integration with a third party product, the Formatter action allows you to manipulate dates, text and numbers inside your recipes. The formatter can accept text or tokens as input, run formatting operations against the value and output the record in your choice of formats.

Here’s an example of the formatter action in use to convert a token passed in from a Gravity Form that contains a date in a text format. In this case, the action is able to recognize the format (we strongly recommend allowing Automator to recognize the date format on its own) and we’re choosing to output the date value as a timestamp.

Uncanny Automator Formatter Action

Supported output formats

The Automator Formatter integration supports converting dates, numbers and text into other formats. Included below is a complete list of output options for each of the 3 Formatter actions.

Time output formats

Any value in some type of date structure can be converted into the formats:

  1. Mmm DD, YYYY
  2. MM/DD/YYYY
  3. MM/DD/YY
  4. DD/MM/YY
  5. DD/MM/YYYY
  6. ISO 8601
  7. RFC 2822
  8. Unix timestamp
  9. The day of the month (from 01 to 31)
  10. A textual representation of a day (three letters)
  11. The day of the month without leading zeros (1 to 31)
  12. A full textual representation of a day
  13. Simple time (12 hour format)
  14. Time with seconds (12 hour format)
  15. Simple time (24 hour format)
  16. Time with seconds (24 hour format)
  17. Timezone offset in seconds
  18. Timezone abbreviation
  19. Difference to Greenwich time (GMT) in hours:minutes
  20. Difference to Greenwich time (GMT) in hours
  21. Whether the date is in daylights savings time (1 if Daylight Savings Time, 0 otherwise)
  22. The ISO-8601 numeric representation of a day (1 for Monday, 7 for Sunday)
  23. A full textual representation of a month (January through December)
  24. A numeric representation of a month (from 01 to 12)
  25. A short textual representation of a month (three letters)

Text output formats

The following conversion options are available for text inputs:

  1. Uppercase
  2. Lowercase
  3. Title case
  4. Capitalize first letters in words
  5. Escape HTML
  6. Remove HTML
  7. Trim spaces around the string
  8. Shuffle
  9. Reverse
  10. Slugify
  11. Character count
  12. Word count
  13. md5 hash
  14. sha256 hash
  15. Nonce create
  16. URL encode
  17. URL decode
  18. Extract Email address
  19. Extract URL
  20. Remove spaces

Number output formats

The following transformations can be performed on number inputs:

  1. Round to integer
  2. Round to one decimal place
  3. Round to two decimal places
  4. Currency English notation (1,234.56)
  5. Currency French notation (1 234,56)
  6. Currency with dot decimals (1 234.56)
  7. Round down (floor)
  8. Round up (ceil)
  9. Is even (returns 1 for even values, 0 for odd)
  10. Default zero (replace empty value with zero)

Using formatted data in a recipe

Input values that are converted to another format using the Formatter are available for use in recipes as action tokens.

Suppose we want to take a value entered in an “Mmm DD, YYYY” format in a form, add 100 days to it, then store the calculated value back to a user meta record in the original date format. The process to do that would look like this:

  1. First, we need to take the entered date value from the form (using a trigger token) and converted it into a timestamp. Why a timestamp? Because as an integer, we can perform math operations to add the 100 days to the value. The action would look like this:
    Convert a date with Automator Formatter
  2. Now we want to add 100 days to the returned value. To do that, we can use the Calculation token inside the second Formatter action’s input field. Notice how we’re using the output of the Formatter as a token, adding 86400 to it (100 days in seconds, since the timestamp is a value in seconds), then passing the calculated value to the formatter.
    Convert timestamp
  3. Finally, we’ll save the reformatted value in a user meta key we’ll call modified_submission_date, which uses the output of the second Formatter:
    Save modified submission date

Now, when the form is submitted, the date will be converted, 100 days will be added, and the updated date record will be stored in user meta in the original format.

Knowledge Base Articles

Back To Top