Solved BP: Removing some of the text from each collection item

Hi Everybody,

Part 1)
Using HTML mode I read table from the web page and stored that values into collections. But I m getting first row value as whole webpage script. i.e (attached screenshot please find it below). why I am getting the data like this?
and also
Part 2)
I want to remove data from brackets . for example my text is like S01234534-VS1234L [02]. and I wanted the result text is S01234534-VS1234L. means with out [02] , I dont want the data which is in brackets.
 

Attachments

  • 3.PNG
    87.9 KB · Views: 62
Last edited:
Part 2)

Using multi calc stage I found a way for this

Step 1) get the length of the text i.e S01234534-VS1234L [02] using Len function
Step 2) Use Instr function for getting the value upto space i .e S01234534-VS1234L .
Step 3) Use trim function for removing space at the end.


see the screenshot for the functions and usage.
 

Attachments

  • 4.PNG
    17.4 KB · Views: 57

VJR

Well-Known Member
Hi Divyarani411,

Part 1) Once double check the spying of the table. At times, we highlight the border of the table but it is not actually a table and some border enclosing around it. Some times there are two borders to a table. So during spying move your mouse very slowly and see how many borders it highlights. Spy and re-spy and see if you get the value as TABLE in the TAG attribute of the Application Modeller.
There could be cases when you may not be able to get the correct table in spite of trying all the above options. So if you are sure that you have got all the required data into the collection then you can think to Delete the unwanted rows/columns.

Part 2) If you are sure that always you are going to have a space in that string then what you did is correct. Else you can search for the opening brace "[" and achieve the same.
 
Hi VJ,

Part 1) As you said, I tried to spy the table again. I am getting the tag value as TABLE only. Tried several times still facing same issue. And aslo that row contains a table value which i need it. so i cant delet that row/column.
please find the attached for attribute properties.
 

Attachments

  • 1.PNG
    97.1 KB · Views: 35

VJR

Well-Known Member
Hi Divyarani411,

If you are still seeing the table tag then you may not get the correct values in the table as that could be the way the html table on the webpage may have been designed.
But you can always form your own collection based on the table.
You can tick mark the Path attribute and make it as Dynamic and then read each of the values from the individual table elements and go on adding them to generate your own collection. If while reading the individual table values if it contains CDATA (Instr CDATA) then you can skip writing that value to the collection and generate the final collection as per your requirement.

There are some posts on the forum about Dynamic Match feature of Blue Prism.
Refer post #3 here and post #5 here.

Another option is since you have already taken everything into a collection, now make this collection of yours neat and tidy.
Things like deleting Column 1 since it appears to be blank in the screenshot, then looping through the collection and writing to another collection without the CDATA value and so on generating the final collection as per your needs.
 
For each page first record i m getting the script values, means I have total 50 pages to read the table data. For each page 1st record I am getting the value like above. so I cant spy each and every
 

VJR

Well-Known Member
Hi Divyarani411,

When you are spying the table for 50 pages you are not spying it 50 times. You are spying it once and using the same to read on all the 50 pages.
Likewise when you use the above suggested options you can create a custom action where you will pass any collection from your webpage and it will return back a corrected collection.
 

vijayakumarvka

New Member
Build an re-usable page then build an loop which uses MID function to remove all other junk expect required result and stores in the same collection.

Let me know if you need the expression for the MID function.
 
Build an re-usable page then build an loop which uses MID function to remove all other junk expect required result and stores in the same collection.

Let me know if you need the expression for the MID function.
Sorry I didn't get you what you r explaining. But when I used AA mode it worked for me. As VJR said , its problem with table of the web page. we have to spy it properly. But with HTML mode i didn't get that.
 
Hi Divyarani411,

If you are still seeing the table tag then you may not get the correct values in the table as that could be the way the html table on the webpage may have been designed.
But you can always form your own collection based on the table.
You can tick mark the Path attribute and make it as Dynamic and then read each of the values from the individual table elements and go on adding them to generate your own collection. If while reading the individual table values if it contains CDATA (Instr CDATA) then you can skip writing that value to the collection and generate the final collection as per your requirement.

There are some posts on the forum about Dynamic Match feature of Blue Prism.
Refer post #3 here and post #5 here.

Another option is since you have already taken everything into a collection, now make this collection of yours neat and tidy.
Things like deleting Column 1 since it appears to be blank in the screenshot, then looping through the collection and writing to another collection without the CDATA value and so on generating the final collection as per your needs.
Problem here is it will not same always. Here it is CData next time it will come with "// function{ra ***********}" like this. so if it same always i could remove unwanted data and will take the data which i want. Dynamic path also I have tried but getting same thing but this time the data starts with
 
Hi Divyarani411,

When you are spying the table for 50 pages you are not spying it 50 times. You are spying it once and using the same to read on all the 50 pages.
Likewise when you use the above suggested options you can create a custom action where you will pass any collection from your webpage and it will return back a corrected collection.
Yes What you said is right. But i have not explained the things properly, sorry for that
 
Top