Branch to identify value using part of string to compare


I want to get the values from input array for only those variables which starts with certain Alphabets. Can someone please help me out to figure the way for this? I am not able to find its correct way.:confused:

Thanks in advance!:slight_smile:

One way is to use a regex in the child step. For example, if you want to take specific action when a field starts with “ABC” then you can do the following:

BRANCH on 'myDoc/myVar'
  /^ABC/: SEQUENCE (this block is executed when myVar starts with ABC)
  $default: SEQUENCE (this block is executed in all other cases

The starting and ending / character indicates to use regex.
The ^ means “start of the variable”.

You may find this article helpful.


Below is the solution

->[Loop] on your list
–>[Branch] on List Item(set evaluate labels to false)
–> [seq_1]/^A.$|^M.$/ (define expression in your seq label)
–> [seq_2] (default or your logic)

The above expression in your seq_1 would identify all the strings starting with char A followed by anything or M followed by anything.Use similar expression for your scenario

hope this helps

Thanks a lot Rob and Anil!

I was doing in the same way… but minor mistake in branch was causing it not to work … thanks again!