Get number of columns Version 1 (Python)
Action group: Office
Description
The action returns the number of columns
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Context | Action context for working with ods/xlsx table. | Robin.OpenSheetD oc | Yes | |
Row index | The sequence number of the row which number of columns is to be retrieved. The numbering starts from 1. | Robin.Numeric | Yes | |
Skip hidden columns | If «true», the action will only count visible columns. | Robin.Boolean | true | No |
Skip empty columns | If «true», the action will only count filled columns. | Robin.Boolean | true | No |
Results | ||||
Result | The number of columns from the specified row. | Robin.Numeric |
Special conditions of use
None.
Example of use
Task
There is a tabular document "Test 1" with a table
You need to get the number of filled columns in row 1.
Solution
Use the "Open", "Get table", "Get number of columns", and "Show message" actions.
Implementation
Assemble a robot scheme consisting of actions:
Fill in the "Path to file" parameter for the "Open" action.
Set the parameters for the "Get table" action.
The "Context" parameter specifies the context of the open tabular document "Test 1".
The "Result" parameter specifies a variable with the "Table" type, in which the table from the open tabular document "Test 1" will be recorded
Set the parameters for the "Get number of columns" action.
In the variable "Context" specify the context of the opened tabular document "Test 1".
In the variable "Row index" specify the row, the number of columns in which you want to get the number of columns.
Check the "Skip hidden columns" and "Skip empty columns" checkboxes.
In the "Result" field, specify a variable of the "Number" type, which will contain the number of columns of row No. 1.
Set the parameters for the "Show message" action.
Launch the robot using the "Start" button in the top panel.
Result
The program robot completed successfully. The number of columns of row No. 1 is obtained.
The message displayed, the counted number of columns.