How do I split this text into a collection?

SERBEM

Member
Hello,

I just cant figure this out, so I am asking for your help.

I have this proces where I read a HTML text and the text could be like this:
Number ID 12345 Name James Lastname Johnson Street xxstreet Street Number 23 Is Customer Yes

How do I get this text string into a collection - I cant split by space, as some of the fields contains two names :-(
My collection should be like
Number ID Name
12345 James
And so on.

The text sometimes contains 10 Fields and other times 7.

Please help me out here guys...
 

SERBEM

Member
Well I have take some screendumps but this is totally fictive names on the adress.
I need the number and the full adress, the adress sometimes contains more information.

Example 1 is of the data I have got so far
Example 2 is my proces I build so far
 

Attachments

  • Example.png
    4.8 KB · Views: 153
  • Example2.png
    17.3 KB · Views: 125

Stephanie

New Member
Is the read HTML text always in the order shown above? So: Number ID 12345 Name James Lastname Johnson Street xxstreet Street Number 23 Is Customer Yes

Then you can use a Multi Calc Stage and combine some text functions there to extract the needed data into a prepared collection. Take a look at my screenshots so you understand what I mean.
 

Attachments

  • DataItem.PNG
    7.5 KB · Views: 134
  • Collection.PNG
    6.9 KB · Views: 127
  • Multi Calculation.PNG
    12.1 KB · Views: 127
  • Collection after Calculation.PNG
    6.7 KB · Views: 103

SERBEM

Member
I have solved this, forgot to mention it here.

It wasn't always in same order, so my solution was to replace those field names that contained more than one name, than split the text, remove empty rows and loop the collection, Starting with a Choice containing all the possible kind of fields who should be used, if one kind is found f.ex. Road than read the value in next row and save the result in a new collection, add one to a counter untill end.
 

Daenerys

New Member
I have solved this, forgot to mention it here.

It wasn't always in same order, so my solution was to replace those field names that contained more than one name, than split the text, remove empty rows and loop the collection, Starting with a Choice containing all the possible kind of fields who should be used, if one kind is found f.ex. Road than read the value in next row and save the result in a new collection, add one to a counter untill end.

HI! I'm struggling with similar issue. Would it be possible for you to share screenshots of your solution? Thanks!
 

Daenerys

New Member
..I now managed to split the text into new collection fields and add values, but for some reason they are invisible in other parts of the process even though they are ticked NOT to hide from other parts of the process. Any idea for what's causing that?
 

Attachments

  • Capturedemo.JPG
    38.3 KB · Views: 91
  • Capturedemo2.JPG
    20.5 KB · Views: 80

gil.silva

Active Member
Hello Daenerys,

The items are not hidden, Blue Prism only shows the columns in the Data Items tree if they're already there in the Initial values of that Collection.
In your case, the columns are created during the run, but it doesn't mean that you can't use them
If you write [Split ValuesExtTest.Namm] in some calculation stage, it will give you the value in that field :)
 

Daenerys

New Member
Hello Daenerys,

The items are not hidden, Blue Prism only shows the columns in the Data Items tree if they're already there in the Initial values of that Collection.
In your case, the columns are created during the run, but it doesn't mean that you can't use them
If you write [Split ValuesExtTest.Namm] in some calculation stage, it will give you the value in that field :)
Thanks for replying, but yeah, I thought it would work like that, but not :( --> ERROR: Internal : Failed to evaluate expression '[Split ValuesExtTest.Personnummer]' - Field 'Personnummer' is not defined in the collection. I unhided the collection and tried to pick data there with calculation stage. In some other forum somebody had recreated the headlines and had it working like that, but I tested that and couldn't get that working either + that is obviously quite a silly resolution as it mades another loop to process which appears unnecessary to me (?)
 

SERBEM

Member
Sorry I totally forgot to reply - This was the solution I made
 

Attachments

  • Pic1.png
    29.9 KB · Views: 118
  • pic2.png
    7.4 KB · Views: 80
Top