cancel
Showing results for 
Search instead for 
Did you mean: 

Wildcard Expressions for Text strings Containing Specific Text

Jason_Acton
Level 3
I have a unique business case to develop logic which will allow for Blue Prism to select one specific option from a list of pull-down menu options in a web-based application, but those pull-down menu options will be DYNAMIC, thus requiring Blue Prism to evaluate current options and "write" or select the appropriate one. Conceptually I know how to achieve this, but am having trouble deriving the correct stages and syntax to achieve the desired goal, and am hoping a more experienced user or consultant can provide assistance. A read stage will read the applicable Pull-Down Menu options and bring them into a temporary collection with one single field (Item Text) and as many rows as there are available options. From there, I need to devise a way to have Blue Prism read EACH line of that collection and determine IF IT CONTAINS a specific set of text characters (for each case, a specific 8-character position number (i.e., 01837452)). The text values read from the pull-down menu will be DYNAMIC, in that they will always have a different number of total characters, and the exact location of the 8-character position number (text) within the matched option's text line will always by DYNAMIC, BUT that 8-character position number text value WILL ALWAYS EXIST in only ONE of those lines. The logical goal I need to achieve is relatively simple - read each line of the available pull down menu option collection, and "find" the line which contains an exact text match for the current 8-character position number, feeding that line to a write stage so it will write/select the appropriate pull-down menu option and proceed with the process. Is there an expression or syntax that can help me isolate an 8-character text value (numbers) from any given string of text, especially if that 8-character text value is already stored in a Data Item for reference?? If so, that would be all I need as I understand logically how to use loops to evaluate and cast data back and forth - just don't know how to use expressions to evaluate/isolate that 8-character text (number) value from a string of dynamic text characters. Does anyone have a precedent for resolving an issue like this and suggestions for a way to address and resolve this unique scenario? Thank you all for your time and consideration!
5 REPLIES 5

TimGrassam
Staff
Staff
Hi Jason I hope I'm not oversimplifying your requirement but it sounds like the InStr function may provide the functionality you require. If you loop through your temporary collection and look for the presence of your required string using InStr you will be able to both confirm the string is present and, if required, the starting location of the string within the text. InStr can be selected from the Text Functions in a calculation or decision stage.

Jason_Acton
Level 3
Thank you for your reply, Tim! It turns out that I was able to enlist the assistance of one of our new team members who has experience with RegEx and coding, and he was able to provide a solution that achieved the desired results. Thank you VERY much for taking the time to reply - I will look into the use of the ""InStr"" function to see if it, too, can achieve the desired results. Thanks again!

TimGrassam
Staff
Staff
Hi Scott I think I may have misunderstood Jason's requirements: You say: ""since the desired selection is unknown i think it would be challenging to implement"" whereas Jason's original post suggested the desired selection is known: ""Is there an expression or syntax that can help me isolate an 8-character text value (numbers) from any given string of text, especially if that 8-character text value is already stored in a Data Item for reference??"" Please could you provide an example of a scenario to help understand what you require a regex evaluation for. It may be that it does already exist in the Product. Thanks

TimGrassam
Staff
Staff
Thanks Scott. I was going to point you at the Business Object actions that utilise Regular Expressions but it appears you're aware of them. What I think you're saying is that it would be good if the functionality existed in calculation / decision stages rather than having to do it through Business Objects.

BuzzaT
Level 4
simple case might be to loop through the strings character by character (simple iteration loop) and find the one that hits IsNumber() = True 8 times in a row. Else yeah, Regex if you can find someone experienced with it.