Branch: If the value is less than 5 words

I want to have a branch piece, if the value is less than 5 words, will this be possible with the branch piece?

You have your value as a preceeding step, you add a code piece that checks the value length, and then based on the result the branch directs traffic.

  1. I added google sheets as a trigger that passes data on new row.

  2. I added a code piece with the following script, using the key textLength as the key where the value was pulling the data from my google sheets trigger.

export const code = async (inputs: { textLength: string }) => {
  if (inputs.textLength.length >= 5) {
    return true;
  }
  return false;
};

  1. Setting up the branch that if the result from the code piece is true then follow true branch or false to the false branch.

1 Like

thanks so much, also do you set the branch to condition = (text) exactly matches

Play with it! That’s how I learned.

You can do any logical expression here-- many ways to skin the cat.

I scrolled further down to “is true” in the menu.

Glad that worked for you.

1 Like

Once again thanks @NotMy1RealName :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.