There are a few ways to do this. Here is what I would do...
- Task.Transcript = "I give the agent 5 thank you for your help"
- Update Data
- New Collection
- String
- Variable name: Task.TranscriptArray
- Value: [Expression] Split(Flow.Transcript, " ")
- You can now parse thru each object of the array...
- Example:
- Task.TranscriptArray[0]
- Task.TranscriptArray[1]
- Task.TranscriptArray[2]
- Task.TranscriptArray[3]
- Task.TranscriptArray[4]
- You can try and compile a Parse(Contains(Task.TranscriptArray, 0,1,2,3,4,5))
- I'm not entirely sure if this works. I know in PowerShell you can loop thru an array with a ForEach iteration. There may be a way for you to set a bool in there of true or false.
I quickly threw together this sample inbound flow, where I used several steps to compile a method to loop thru each word using the baked in loop function and leveraging the Object[Int] position to reference each word in the array. The loop counter and evaluation is very primitive, but does function by picking up an integer of AnyOneOfThese(0,1,2,3,4,5) from any position of the transcript array. Go ahead and publish it in your sandbox and call it, let me know if that was something you were looking for.
I an unable to upload .yaml or .i3InboundFlow file types into this forum, so after you download them, revert the file extension to the respective type before you review or import.
------------------------------
Carlos Albor
Senior Principal PS Consultant
------------------------------