Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


kgilreath
2021-08-09T16:39:56Z
I have a while loop that checks a string variable for the word 'Success'. I'd like for the loop to check for words 'Success' or 'Warning. Is there syntax that allows to check multiple words?

image.png
Sponsor
Forum information
Gary_W
2021-08-09T21:41:47Z
You could use Thomas' StringContains function from the task repository once you download it:

{TASKREPOSITORY(d6ca5c3b-02bc-432e-8438-fa8006fe79dd|StringContains(Success(String);Success:Failure(String);:(String))|)}

From the help:
Returns true if string contains search string. Multiple searchstrings allowed

haystack: The string to be searched
needles: A string with characters that should be searched for. Separated by delimiter
delimiter: The delimiter used in needles

Example:
haystack = abcde
needle = x;d
delimiter = ;

Searches string abcde for x or d. Returns true


Be advised though this function will return True if the word is also part of a word, i.e. "Successful" as the haystack in my example will also return True.

kgilreath
2021-08-10T03:03:10Z
Thanks, I'll check that out!
kgilreath
2021-08-10T03:44:11Z
That function worked perfectly, thanks again!
Support
2021-08-24T15:02:31Z
Originally Posted by: kgilreath 

That function worked perfectly, thanks again!



Glad you got it working!
Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
Scroll to Top