What does it do?

If-else nodes, as the name suggests, allow you to create conditional logic in your Wordapp. This means you can make your Wordapp do different things based on the content it’s generated so far, or the inputs it’s received.

If-else nodes give Wordapps the ability to make decisions, and sit at the heart of the intelligence AI provides. With Wordware, you can trivially pass data back and forth between software and AI, leveraging whichever form of intelligence is best for each point of your workflow.

If-Else in the Editor

Did you know that Wordapps are Turing complete? The combination of if-else nodes and loop nodes make Wordapps capable of carrying out any computation a computer can!

How do I use it?

An if-else node is made up of a series of conditions, each with a corresponding action. When the node runs, it checks each condition in turn, running the nodes inside the first section where the condition is true.

To create an if-else node, type /if in the editor, and hit Enter. You’ll be prompted to fill in some details about the node, like its name, and the conditions and actions you want to include.

If-Else in the Sidebar

Conditions

Conditions are set in the sidebar under the Expressions section, with each condition (IF) having two slots for inputs, and three ways to compare them:

ComparisonHow it works
MatchChecks if the two values are equal
ContainsChecks if the first value contains the second value
RelativeCompares two numeric inputs, with sub-options for the comparison operator (e.g. >, <)

The Match and Contains comparison types also have toggles for case sensitivity and how to treat symbols and whitespace.

You can add as many conditions as you like with the ADD IF + button below all the existing conditions. There’s also an ELSE condition, which runs if none of the other conditions are true.

Actions

Actions are set in the editor under the appropriate condition, allowing for generations, mentions, and any other node types to be run depending on which condition is true.

The if-else example above, for example, works as follows:

1

If

First, the IF condition checks if the @is_known_user mention is the text “true”. If so, the Wordapp will run the nodes inside this section:

If Action

2

Else

Then, if the above condition is not met, the Wordapp will run the nodes inside this section:

Else Action