How can I put a variable into the row/column part of a data table name?

Haddi Ogunsola 1 Reputation point
2022-06-29T01:23:59.087+00:00

If I want to have a if statement that reads data from a data table that reads a different row of the table every time the loop repeats, how could I put a numeric variable in the row section?

What I have right now is this:

if
%DataFromWebPage[%RowCount%][2]

When I try to run this, I get a syntax error, so how could I make the %RowCount% variable syntax compliant?

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,381 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,371 Reputation points
    2022-06-29T15:16:12.077+00:00

    Hello,

    in my understanding you need to do a Loop that is the exact number of times = to the rows in the table?

    And your settings look something similar like: Parameters - Start from:, End to: = %DataFromWebPage.RowsCount% and Increment by 1 where the variables produced = LoopIndex

    You can directly get the web table into a Datatable variable of PAD and then loop through it. Use "Extract data from web page" to capture the html table which would return the results in a datatable. Detect any table value as an UI element more than once and PAD will automatically convert it to a table. You dont need to have a count variable. Make sure to use the "For each" action and pass the name of the datatable (in this case DataFromWebPage).

    ----------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments