Search code examples
vb.netscreen-scrapinguipathuipath-studiouipath-activity

<screen scraping in uipath> combine split numbers


I would like to screen scrape a few user details including the handphone no. from one application and paste the details into another application. There's a spacing in the handphone no. e.g. 8123 4567. I would like to remove the spacing and paste 81234567 into the other application.

I have use Build Data Table and Write Range to store the captured information in. In the handphone no. screen scrape activity, I did the following additional steps to split the numbers and combine them into 1. It works the first few times but when I tried running the script a few days later, it stopped working. Basically, the handphone no. is not completely copied over. Sometimes it returns as 8123 and sometimes as 812.

Assign

    ArrayHandphoneNo = HandphoneNo.Split({" "},stringsplitoptions.None)

Assign

    HandphoneNo = ArrayHandphoneNo(0)

Try Catch

    HandphoneNo = HandphoneNo + ArrayHandphoneNo(1)

    Catches exception

Assign

    HandphoneNo = HandphoneNo

May I know what went wrong?


Solution

  • Why you having a workaround. From my perspective you simply need a line of code that is removing all spaces. So you get back the full digit number. So try with this:

    myString = myString.Replace(" ", "")
    

    in your assign activity.

    Could look like this one: UiPath Studio process