How to look for words

Hey!

How can I get specifics words from a row and add a value for thouse words?
Eg: There is a column for comments and I want to create a workflow that if some of several words are being added to the comments, set a numeric value for thouse words and then triger the email in the worflow.
For this Iยดm thinking to combine a VC with the expression filtering condition and then the action if the condition in the VC is true.

Solved Solved
0 13 788
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

Create a separate table with the words to look for and their respective scores, then:

SUM(
  SELECT(
    Trigger Words[Score],
    IN(
      [Word],
      SPLIT(
        [_THISROW].[Comments],
        " "
      )
    )
  )
)

This very inefficient: the SPLIT() would be better moved to a virtual column. Punctuation in the Comments column value will be a problem.

Alternatively:

SUM(
  SELECT(
    Trigger Words[Score],
    CONTAINS(
      [_THISROW].[Comments],
      [Word]
    )
  )
)

Thatโ€™s probably the better choice.

View solution in original post

13 REPLIES 13

If your match words list is not long, you can do it using CONTAINS(). May be slow but it could work.

Steve
Platinum 4
Platinum 4

Create a separate table with the words to look for and their respective scores, then:

SUM(
  SELECT(
    Trigger Words[Score],
    IN(
      [Word],
      SPLIT(
        [_THISROW].[Comments],
        " "
      )
    )
  )
)

This very inefficient: the SPLIT() would be better moved to a virtual column. Punctuation in the Comments column value will be a problem.

Alternatively:

SUM(
  SELECT(
    Trigger Words[Score],
    CONTAINS(
      [_THISROW].[Comments],
      [Word]
    )
  )
)

Thatโ€™s probably the better choice.

Thanks!
I will try those options

@Steve
Works perfect! Thanks

@Steve

The formula is working fine, but here is the thing.
Eg: I had a word in the Trigger words table that is โ€œLateโ€ and another word that is โ€œHateโ€ both word had a minus value, so if in Comments there are no such words, the formula is taking the โ€œateโ€ as minus values for any word that has the letters โ€œateโ€ or โ€œlatโ€ or โ€œhatโ€, so the result for this would be wrong.
How can I filter the condition on the formula to mach the correct word?

This is kind of mining data formula what I am trying to fetch, that why I need too get the exact word not any extract of the letters,

Unfortunately, I cannot see a way to accomplish what you want: AppSheet doesnโ€™t have the mechanisms needed to adequately separate words reliably.

The first of the two options I offered uses SPLIT() to separate individual words and IN() to match whole words, but any punctuators (e.g., period, comma, semicolon) that are immediately adjacent to a word would be captured as part of that word, preventing an exact match.

For instance, the simple sentence, โ€œHello there, John.โ€, would be split in the words, โ€œHelloโ€, โ€œthere,โ€ (with a trailing comma), and โ€œJohn.โ€ (with a trailing period). If you then asked whether the whole word โ€œJohnโ€ occurs in that sentence, youโ€™d be told no because โ€œJohnโ€ and โ€œJohn.โ€ (with a trailing period) are different.

Hey Steve,
I was thinking about this, is it posible to play with an equalsIgnoreCase, or something similar to it?

What do you mean?

Eg:

If I have the word John or john or john. can I use an expression such as IgnoreCase or something similar to it so then I can get the word ignoring if the word had upper case or period, comma or semicolonโ€ฆetcโ€ฆ?

The most important thing is to get the word itself so I can create a filter and a workflow if that word or other words appear in a text.

All textual comparisons are case-insensitive (i.e., they ignore case). There is no mechanism for ignoring non-word characters (such as punctuation).

Is there a way to add an expression to avoid (comma, punctuation, semicolon) between words?
Eg: an expression that only allow comma, punctuation, semicolon only if there is an space between words.

There is no way to do it given the current functions. You could create a feature request post to request it.

Yes, that would be something to think about

Top Labels in this Space