Hi all -
My apologies in advance if this is something with an obvious answer. I've consulted documentation and Copilot and Microsoft Learn and nothing I've tried so far has worked. I'm new to RPA and Power Automate, and my background is in data analytics and reporting, so I don't have a great deal of experience with front-end GUI components, and I think that lack of knowledge is hurting me here.
I'm working on a desktop flow to automate the process of copying data out of web-based lab information management system named LabVantage. As far as I've been able to determine, there is not customer connector for accessing the data in this system via the back end. In the flow, I have a variable named "BatchNumber" that holds a string value. The flow opens LabVantage with a "Open Microsoft Edge browser" action that navigates to the appropriate location. On the LabVantage page, there will be a table with a varying number of rows. The leftmost column of the table contains hyperlinks, one for every row, and the text labelling one of the hyperlinks will match the string value that's stored in BatchNumber. I'd like to make the flow click on the link with the matching label value, but I haven't been able to figure out how to get the list of hyperlinks into a list variable that I can iterate through to see if there's a match.
1. How to change them from the default values of "Column1" and "Column2" in the "Create new data table" action:
Just click on the header column name and type something, you can able to change it
2. How to access the code:
Pls follow the below steps
Thanks,
Deenuji Loganathan
🤖 Automation Evangelist
Deenuji - Follow me on LinkedIn
-------------------------------------------------------------------------------------------------------------
If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🌟
Thanks, Deenuji, this was extremely helpful. If you don't mind a couple of follow up questions:
* How did you assign the column names to the HyperlinkDataTable object? I can't change them from the default values of "Column1" and "Column2" in the "Create new data table" action.
* Where can I access the code view of the flow that you provided an the end of your response?
And thanks once again for your nicely detailed response!
Hi @Ipsifendus,
Please follow the below example related to your use case:
1. Launch Google Chrome:
Open Google Chrome browser and Go to the URL: https://en.number13.de/adding-clickable-links-to-a-html-table/.
2. Extract HTML Table Data:
Locate the HTML table within the webpage.
Extract data from the HTML table as mentioned in the above screenshot and these table text extracted as data table
3. Retrieve Data into a List:
Retrieve the data from the first column of the extracted table.
Store the retrieved data into a list named ColumnAsList like below.
4. Create a New DataTable for Hyperlinks:
Create a new DataTable with columns named 'Text' and 'Hyperlink'.
Initialize an empty DataTable named HyperlinkDataTable.
5. Loop Through Each Item in the List:
For each item in the ColumnAsList:
And in the UI element replace anchor text with variable(where it hold of current hyperlink text)
Now we have "HyperlinkDataTable". Its kind of temp datatable where it hold your table text and hyperlinks like below:
Then you can use another for each loop to iterate your temp datatable to find your text is matching or not.
Hope this helps!!
Full flow details:
Code[you can copy and paste the below code in your PAD designer but recapture all the UI selector]:
WebAutomation.LaunchChrome.LaunchChrome Url: $'''https://en.number13.de/adding-clickable-links-to-a-html-table/''' WindowState: WebAutomation.BrowserWindowState.Maximized ClearCache: False ClearCookies: False WaitForPageToLoadTimeout: 60 Timeout: 60 PiPUserDataFolderMode: WebAutomation.PiPUserDataFolderModeEnum.AutomaticProfile BrowserInstance=> Browser
WebAutomation.ExtractData.ExtractHtmlTable BrowserInstance: Browser Control: $'''html > body > div:eq(0) > div > div:eq(0) > div:eq(1) > table''' ExtractionParameters: {[$'''Value #1''', $'''Value #2'''], [$'''''', $''''''] } PostProcessData: False TimeoutInSeconds: 60 ExtractedData=> DataFromWebPage
Variables.RetrieveDataTableColumnIntoList DataTable: DataFromWebPage ColumnNameOrIndex: 0 ColumnAsList=> ColumnAsList
Variables.CreateNewDatatable InputTable: { ^['Text', 'Hyperlink'], [$'''''', $''''''] } DataTable=> HyperlinkDataTable
LOOP FOREACH CurrentItem IN ColumnAsList
Text.Trim Text: CurrentItem TrimOption: Text.TrimOption.Both TrimmedText=> TrimmedText
WebAutomation.GetDetailsOfElement BrowserInstance: Browser Control: appmask['Web Page \'h ... tml-table/\'']['Anchor \'Cities Skylines\''] AttributeName: $'''HRef''' AttributeValue=> AttributeValue
Variables.AddRowToDataTable.AppendRowToDataTable DataTable: HyperlinkDataTable RowToAdd: [TrimmedText, AttributeValue]
END
LOOP FOREACH CurrentItem2 IN HyperlinkDataTable
Text.ParseText.ParseForFirstOccurrence Text: CurrentItem2[0] TextToFind: $'''\"your text\"''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> Position
END
Thanks,
Deenuji Loganathan
🤖Automation Evangelist
Deenuji - Follow me on LinkedIn
-------------------------------------------------------------------------------------------------------------
If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🌟
Hi @Ipsifendus
Use extract data from we page action
and there will be live web helper pop up and select extract drop down whatever you need like single value, table, list etc....please refer below image
Hope this helps
Usha.
WarrenBelz
146,731
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,075
Most Valuable Professional