Tag: ImportFileIntoGrid, ImportExcelInGrid
The ImportFileIntoGrid (alias ImportExcelInGrid) action uses a file as input to insert its content into a grid.
Detailed Description
When an Excel/CSV file and a grid can be matched through key columns, eg, an email column in the file and an email column in the grid, each column of the file can be inserted as a column in the grid.
This will only be applied to the currently selected rows in the grid.
These columns are volatile and disappear when the module containing the grid is closed..
Once inserted, the new grid columns may be processed like any other column (sorting, grouping, export…).
Tag Attributes
|
Attribute |
Description |
|---|---|
|
Target |
The corresponding Grid Code Sets the target grid panel. Not Required If no target is set, the default main grid target will be used. |
|
ImportKey |
Name of the column from the file to use as the key that connects the data in the file with the data in the grid. Required |
|
GridKeyUID |
Unique ID of the column from the grid, as shown in the Grid Manager, to use as the key that connects the data in the file with the data in the grid. Required |
|
FilePath |
Full or relative (to the current automation script) path of the file to import. Required |
|
MatchSelectedRowsOnly |
If True, only selected grid rows will be matched.
|
|
Separator |
If a cell value represents a list and this list is to be inserted as a multi-value field in the grid, this parameter is used to separate each element in the list. Not Required |
|
SkipValue |
Cell value to be interpreted as 'do nothing here'. Nothing is skipped if this is missing.
|
|
Family |
Name of family Multivalue for the imported columns If the family exists in the grid, the imported columns are integrated according to the current status of the rows: values for exploded rows are set as part of the corresponding multivalue set, unexploded rows are set as mulitvalues. It is highly recommended to use unexploded imports (set with the Separator parameter) to unexploded grids, and exploded imports (no separator set) with exploded grids. Missing values (no match between list key and grid key) are set as No Value. If the family does not exist, it is created. Not Required |
The selection of the file columns to import is made through one or several SetParam actions set as children of the ImportExcelInGrid action.
SetParam Tag Attributes
|
Attribute |
Description |
|---|---|
|
Value |
File Column name. Required |
|
ColumnID |
Unique ID for the grid column that will contain the imported data of the file column set in Value. Required. This UID is then automatically prefixed with the text: _IMPORTED_ |
|
ColumnTitle |
Title of the imported grid column. Not Required If not set, the title from the file is used. |
Example Script
<ytriaAutomation>
<ShowUsers>
<Select lines='all'/>
<ImportExcelInGrid ImportKey='Name' GridKeyUID='userPrincipalName' Filepath='D:\dev\Temp_XML\USERPROJECTS.xlsx'>
<SetParam Value='Project' ColumnID='ProjectXL'/>
<SetParam Value='Score' ColumnID='ScoreXL'/>
</ImportExcelInGrid>
</ShowUsers>
</ytriaAutomation>
This script matches the grid column with UID userPrincipalName to the file column titled Name and imports the two columns Project with original title and UID _IMPORTED_ProjectXL, and Score with original title and UID _IMPORTED_ScoreXL.