Verifying Bank Sort Code has been typed in correctly

Hi all

I use a bank account Sort Code supplied in a queue item and enter this in the required field.

In the queue item it is supplied with out the dashes (e.g 403020). When the robot enters this on screen it shows as 40-30-20. In the United Kingdom bank sort codes are always 6 numbers seperated by 2 dashes xx-xx-xx)

In my post condition I want to check this has been typed in correctly. I use the get text function to get the Sort Code inputted and check this against the one supplied by the queue. I do this in an IF statement but this always fails due to the dashes

Here is my code

The strPostConditon is the variable from the get text function (so in this example will contain 40-30-20) and the in_StrSortCodeText contains the sort code supplied by the queue (so will be 403020)

Please can I ask if you are able to write the code for me that goes in the IF statement to check if the sort code from the queue has been typed in to the Sort Code field?


If it helps, this is how is looks on the screen


Hi Jordan!

Try replacing all the dashes with nothing!
If strPostCondition.Replace("-","") = in_StrSortCodeText



Yes! That makes sense. Will try that now and mark as the solution when I’ve ran the code :slight_smile:
Thank you!


works a treat, thank you :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.