Problem with Type into command in web form

Hi, I have created an activity that reads data fields from a CSV file, creates a data table and for each row in my data table, writes to a web-form.

One of the web-form fields contains drop-down entries in the following format:
AA - Axxxx Axxxx
AE - Axxx Exxx
B - Bxxx
D - Dxxx

When I type (manually) into the web-form the field only seems to evaluate the code eg “AA” (up until the hypen). This presents a problem because as you can see there are both single “B” and double-digit codes like “AA” in the list.

In my source file, the corresponding data-field is longer than 2 digits (but contains the code used in the web-form), so I must use a transformation to extract characters ready to enter into the web form. I can ustilise an extract function for 2 digits like


How do I write an extract function to handle both single and double-digit codes in the web form?

Should I be evaluating the field in the web form using something like Find children first?

I would really appreciate some help with this?!