What is the best way to use text expression (left(), right()) in decision and choice stage?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-09-17 12:03 PM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-09-17 01:11 PM
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-09-17 01:20 PM
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)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-11-17 07:42 PM
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-11-17 01:59 PM
There is no IF in a BP expression, the Decision stage itself is the IF statement.
