Hi (Im not sure if i manage to address this post to the correct section in the forum, so just move it to correct location).
Im up for a task to pull out Build-logs from Azure DevOps (from mainly two pages, one page is a pipeline page that contains Description of the PR - pull request and a set of flags), and then to insert this build log into another system. Up till now, this have been done manually but we are going to automate this task as it can be time consuming.
My first task is to scrape the pipeline page, which is fine, i collect mainly 3 pieces of information:
Description
URL behind the description-field
Flag (that contains either “xxxxx Publish Success xxm xxs” or “xxxxx Publish Skipped” )
So i basically then got a dt - datatable with these 3 columns.
To speed up and remove all the things i do not need, i run a Filter Data Table. All i am left with is items that contains the text “*Hotfix - Merged PR” and either a “xxxxx Publish Success xxm xxs” or “xxxxx Publish Skipped” flag.
i have been testing and testing and trying to figure out how i can solve the next bit.
Goal: I want to keep the first occurrence of “xxxxx Publish Success xxm xxs” and all the items between till and including second occurrence of “xxxxx Publish Success xxm xxs” flag.
I am not sure if i really can accomplish this at all with Filter Data Table activity. Somethings tells me that this should probably be done with LINQ,or maybe a For Each, but unfortunately i dont not speak LINQ.
I hope there is some souls out there that have some good ideas.
XML from the scraping:
<extract>
<row exact='1'>
<webctrl tag='a' />
</row>
<column exact='1' name='Desc' attr='text' name2='URL' attr2='href'>
<webctrl tag='a' />
<webctrl tag='td' idx='2' />
<webctrl tag='div' idx='1' />
<webctrl tag='div' idx='1' />
<webctrl tag='span' idx='1' />
</column>
<column exact='1' name='Flag' attr='text'>
<webctrl tag='a' />
<webctrl tag='td' idx='3' />
<webctrl tag='div' idx='1' />
<webctrl tag='div' idx='1' />
<webctrl tag='span' idx='1' />
<webctrl tag='span' idx='1' />
<webctrl tag='span' idx='1' />
<webctrl tag='span' idx='1' />
<webctrl tag='span' idx='9' />
<webctrl tag='span' idx='1' />
<webctrl tag='a' idx='1' />
<webctrl tag='svg' idx='1' />
</column>
</extract>
Filter Data Table
I have started to use a For each row in Data Table, but i am not sure if this is the correct approach or if i should just use Filter Data Table activity, or if there could maybe be some LINQ activity?
This is basically the output from the datatable, so i want to keep first and second occurrence and everything in between.
There might be a third and fourth occurrence of “Success” but i do not need/want that.
All advice or ideas is helpful to me, thanks.