KeyRoutines

Variables, text and data

Store values, format text, do maths, parse JSON and pass results from one step to the next.

Steps (26)

Step · Data and variablesFree

Add to date

Add to date moves a date forward by an amount you choose, from seconds up to years. Leave the date empty and it starts from right now, which makes "one week from today" a single step.

Step · Data and variablesFree

Time between dates

Time between dates measures the gap from one date to another in the unit you pick. Leave the later date empty to measure up to now, which is how you ask "how long since" or "how long until".

Step · Data and variablesFree

Format date

Format date writes a date as text in the layout you choose. It's the step behind dated file names, readable times in messages and timestamps in log files.

Step · Data and variablesFree

Read date

Read date turns text that holds a date into a real date the other date steps understand. It also hands you its parts, so you can check the weekday or month on their own.

Step · Data and variablesFree

Subtract from date

Subtract from date moves a date back in time by an amount you choose. With the date left empty it counts back from now, so "30 days ago" takes one step.

Step · Data and variablesFree

Count dictionary entries

Count dictionary entries tells you how many named entries a dictionary has. It also gives you separate lists of the names and the values, which is handy for going through them one by one.

Step · Data and variablesFree

Get dictionary value

Get dictionary value looks up one entry by its name. It's how you take a single setting or field out of a dictionary your routine built or received.

Step · Data and variablesFree

Remove dictionary key

Remove dictionary key gives you a copy of a dictionary without one entry. The original stays as it was, so earlier steps' results never change under you.

Step · Data and variablesFree

Set dictionary value

Set dictionary value adds an entry to a dictionary or replaces one with the same name. Leave the dictionary empty to start a fresh one, which is a simple way to bundle related values.

Step · Data and variablesFree

Add to list

Add to list puts one item into a list. It's how a routine collects things as it goes, like file names found in a loop or answers to several questions.

Step · Data and variablesFree

Count list items

Count list items tells you how long a list is and whether it's empty. It's the quick check before a loop, or the number you show at the end.

Step · Data and variablesFree

Get list item

Get list item takes one item from a list by its position. Use it to grab the first search result, the last line of a file, or a random pick from a list.

Step · Data and variablesFree

Remove from list

Remove from list takes items out of a list, either by matching a value or by position. You get a new list back and the original stays untouched.

Step · Data and variablesFree

Sort list

Sort list puts the items of a list in order, A to Z or Z to A. For lists of dictionaries, like file details, you can sort by one field such as name or size.

Step · Data and variablesFree

Remove duplicates

Remove duplicates keeps one copy of each value in a list and drops the repeats. It's the tidy-up step after collecting things from several places.

Step · Data and variablesFree

Calculate

Calculate works out a formula you type, like a price times 1.2 or a volume minus 10. Values from other steps go straight into the formula, so you can do real maths without a separate tool.

Step · Data and variablesFree

Random number

Random number picks a number between a smallest and largest value. By default it's a whole number from 1 to 100, like a dice with a hundred sides.

Step · Data and variablesFree

Round number

Round number tidies a number to the decimals you want. Choose nearest, always up or always down, for neat display or for steps that need whole numbers.

Step · Data and variablesFree

Change case

Change case rewrites text in upper case, lower case, or with a capital first letter. It's a quick fix for clipboard text, file names and anything that needs to look consistent.

Step · Data and variablesFree

Find with a pattern

Find with a pattern searches text with a regular expression and hands back what it found. It's how routines pull a code, a number or a link out of a longer piece of text.

Step · Data and variablesFree

Join list

Join list glues the items of a list into one text, with a separator of your choice between them. It's the opposite of Split text and the usual last step before showing or saving a list.

Step · Data and variablesFree

Read JSON value

Read JSON value finds one value inside JSON you already have, such as an API answer, copied text or a list or dictionary from an earlier step. Use it when you need one field out of a bigger answer. To read a JSON file on disk, use the Files pack's Read JSON value step.

Step · Data and variablesFree

Replace text

Replace text finds every occurrence of something in a text and swaps it for something else, or removes it. It works on clipboard text, file contents and step results alike.

Step · Data and variablesFree

Split text

Split text breaks one piece of text into a list. Split at commas, at line breaks or into characters, then loop over the parts or pick one out.

Step · Data and variablesFree

Trim text

Trim text cleans the edges of a text, removing spaces and line breaks from the start, the end or both. It's the quiet fix for copied values that don't compare the way you expect.

Step · Data and variablesFree

Encode for a web address

Encode for a web address turns text into a form that's safe inside a link, so spaces and symbols don't break it. It can also decode %XX codes in a link back into normal text.

How-to guides

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.