cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to use text expression (left(), right()) in decision and choice stage?

AnshulBhatia
Level 2
Consider a data item of type text called "Data1" ; Data1=Continent I want to use a decision and choice stage If( left(Data1,3)) = Con - then take Yes path else No --THROWS ERROR INCORRECT USE OF FUNCTIONS; Same for choice. check for if(left(Data1,3) is equal to Con - then choice 1 stage if(left(Data1,3) is equal to Nen - then choice 2 stage etc Please suggest the right syntax to use text expressions in decision and choice stage
4 REPLIES 4

OlaNykvist
Level 3
This seem to work for me: Expression in decision stage: Left([Data1]; 3) = ""Con"" - then connect the ""Yes"" and ""No"" paths Note that function names are case sensitive and strings needs to be enclosed in quotes.

I don't think blueprism support if-function like you wrote. 1. Take a ""Decision"" block where you want it to me 2. Open and write: Left([Data1]; 3) = ""Con"" 3. Choose where Yes and No go. Remember that BP don't support to write function in Decision block (as I'm aware of)

DexterWhelan1
Level 4
Hi anshbat, the exact syntax of left or right is as follows Left([Message], 3) = ""FOO"" or Right([Message], 3) = ""FOO"" and they output True or False. If you have a decision stage (the diamond stage) and you put one of these statements in, it should work for you then. Left([Data1],3) = ""CON"" Should be the context you are looking for. You don't need to write 'if' in the stage either, just the text above. Then connect the decision stage to the Yes/No stages you want them connected to.

John__Carter
Staff
Staff
There is no IF in a BP expression, the Decision stage itself is the IF statement.