|
Dataset - Move row |
Declaration
<AMDATASET ACTIVITY="move_row" DATASET="text" SRCINDEX="number" ROWLOCATION="text (options)" DESTINDEX="number" />
Description
Moves a row anywhere in a dataset.
Practical Usage
Used to move a row anywhere in a dataset.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Dataset name | Text | Yes | (Empty) | DATASET="Customers" | Specifies the dataset to move the row in. |
Source row index | Number | Yes | (Empty) | SRCINDEX="2" | The current row index number of the row to move. |
Move to | Text (options) | Yes | End |
|
Specifies where to move the row to. The options are:
|
Destination row index | Number | Yes, if Move to is set to Row index | (Empty) | DESTINDEX="5" | The row index number to move the row to. This parameter is required if Move to is set to Row index. NOTE: The row index number entered must be greater than 0. |
Examples
- The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
- Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.
Example 1
This task uses the Create and Insert Row Dataset activities to create a dataset with three columns and three rows, and then the first row to the end of the dataset.
<AMDATASET RESULTDATASET="myDataset" COLUMNS="heading1;heading2;heading3" DELIMITER="semi_colon" DESCRIPTION="This is user input description showing in variables panel of Task Builder" />
<AMDATASET ACTIVITY="insert_row" DATASET="myDataset" ROWLOCATION="end"><COLUMNSETTER COLUMNNAME="heading1" VALUE="Row 1" /><COLUMNSETTER COLUMNNAME="heading2" VALUE="value2" /><COLUMNSETTER COLUMNNAME="heading3" VALUE="value3" /></AMDATASET>
<AMDATASET ACTIVITY="insert_row" DATASET="myDataset" ROWLOCATION="end"><COLUMNSETTER COLUMNNAME="heading1" VALUE="Row2" /><COLUMNSETTER COLUMNNAME="heading2" VALUE="value2" /><COLUMNSETTER COLUMNNAME="heading3" VALUE="value3" /></AMDATASET>
<AMDATASET ACTIVITY="insert_row" DATASET="myDataset" ROWLOCATION="end"><COLUMNSETTER COLUMNNAME="heading1" VALUE="Row3" /><COLUMNSETTER COLUMNNAME="heading2" VALUE="value2" /><COLUMNSETTER COLUMNNAME="heading3" VALUE="value3" /></AMDATASET>
<AMDATASET ACTIVITY="move_row" DATASET="myDataset" SRCINDEX="1" ROWLOCATION="end" />
Example 2
This task uses the Create and Insert Row Dataset activities to create a dataset with three columns and three rows, and then moves the first row to the second row.
<AMDATASET RESULTDATASET="myDataset" COLUMNS="heading1;heading2;heading3" DELIMITER="semi_colon" DESCRIPTION="This is user input description showing in variables panel of Task Builder" />
<AMDATASET ACTIVITY="insert_row" DATASET="myDataset" ROWLOCATION="end"><COLUMNSETTER COLUMNNAME="heading1" VALUE="Row 1" /><COLUMNSETTER COLUMNNAME="heading2" VALUE="value2" /><COLUMNSETTER COLUMNNAME="heading3" VALUE="value3" /></AMDATASET>
<AMDATASET ACTIVITY="insert_row" DATASET="myDataset" ROWLOCATION="end"><COLUMNSETTER COLUMNNAME="heading1" VALUE="Row2" /><COLUMNSETTER COLUMNNAME="heading2" VALUE="value2" /><COLUMNSETTER COLUMNNAME="heading3" VALUE="value3" /></AMDATASET>
<AMDATASET ACTIVITY="insert_row" DATASET="myDataset" ROWLOCATION="end"><COLUMNSETTER COLUMNNAME="heading1" VALUE="Row3" /><COLUMNSETTER COLUMNNAME="heading2" VALUE="value2" /><COLUMNSETTER COLUMNNAME="heading3" VALUE="value3" /></AMDATASET>
<AMDATASET ACTIVITY="move_row" DATASET="myDataset" SRCINDEX="1" ROWLOCATION="index" DESTINDEX="2" />