Make "contains" for only part of a repeating group's value

I am using a live speech to text plug in. You can see the words you speak appear in a text box I created. When the value of the Live speech to text plug in “contains” a text value from a repeating group it stops recording. I designed this feature myself by using a “when value changes” event because I wanted it to stop without the user having to press a button. However, the messages of the repeating group can be very long and multiple sentences. This makes it very difficult for the user to get every single word and punctuation mark correctly in order for the speech recorder to stop. If it isn’t word for word correct then the plug in will keep recording and not shut off. Is there a way to make a “contains” condition for only the last word or few words of the repeating group’s text value? That way it only has to contain a couple words and its easy to understand when to stop recording. Also, this would have to be a dynamic value as the text in the repeating groups will be different every time. Here is a photo of my current workflow when condition so that you can see it. If there are any other suggestions to fix this problem please let me know as well.

There are probably better methods but right now this one answers exactly what you are asking : extracting the last few words from a sentence.

image

What it does

  1. It start by truncating the sentence to keep only the last X characters.
  2. Then it splits that by " " whitespace.
  3. It makes a list of text based on this.
  4. From the list of text, you remove the first thing because it probably is a broken word because the truncate operation most certainly was done in the middle of a word.
  5. From the remaining words in the list, you make it back to a text.

Okay I have this working for the most part. Everything is separated by commas which I can fix with a find and replace. However, what are the better methods you can think of to accomplish this same task? I am just curious because there are still errors that I am facing with this method and wanted to know if you had something in mind that could make my sequence better. I would appreciate the feedback. Thanks

This topic was automatically closed after 70 days. New replies are no longer allowed.