Get number of columns Version 1 (Python)

Action group: Office


Description

The action returns the number of columns

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for working with ods/xlsx table.Robin.OpenSheetD oc
Yes
Row indexThe sequence number of the row which number of columns is to be retrieved. The numbering starts from 1.Robin.Numeric
Yes
Skip hidden columnsIf «true», the action will only count visible columns.Robin.BooleantrueNo
Skip empty columnsIf «true», the action will only count filled columns.Robin.BooleantrueNo
Results
ResultThe 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.

  • Нет меток