{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\
{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#rowIndex]
Get or set the record index of the dataset.{td}{tr}{tbody}{table}\\
{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#addColumn]\(name, index, type)
adds a column with the specified name to the dataset.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addHTMLProperty]\(row, col, name, value)
Add an HTML property to an HTML tag produced in getAsHTML().{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addRow]\(index, array)
Add a row to the dataset.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#createDataSource]\(name, types)
Create a data source from the data set with specified name and using specified types.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getAsHTML]\(escape_values, escape_spaces, multi_line_markup, pretty_indent, add_column_names)
Get the dataset as an html table.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getAsText]\(column_separator, row_separator, value_delimiter, add_column_names)
Get the dataset as formatted text.{td}{tr}{tbody}{tbody}{tr}{td}Object[]{td}{td}[#getColumnAsArray]\(index)
Get the column data of a dataset as an Array.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getColumnName]\(index)
Get a column name based on index.{td}{tr}{tbody}{tbody}{tr}{td}[ServoyException]{td}{td}[#getException]\()
Get the database exception if an error occurred.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getMaxColumnIndex]\()
Get the number of columns in the dataset.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getMaxRowIndex]\()
Get the number of rows in the dataset.{td}{tr}{tbody}{tbody}{tr}{td}Object[]{td}{td}[#getRowAsArray]\(index)
Get the row data of a dataset as an Array.{td}{tr}{tbody}{tbody}{tr}{td}Object{td}{td}[#getValue]\(row, col)
Get the value specified by row and column position from the dataset.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#hadMoreData]\()
Return true if there is more data in the resultset then specified by maxReturnedRows at query time.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#removeColumn]\(index)
Remove a column by index from the dataset.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#removeRow]\(row)
Remove a row from the dataset.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setValue]\(row, col, obj)
Set the value specified by row and column position from the dataset.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#sort]\(col, sort_direction)
Sort the dataset on the given column in ascending or descending.{td}{tr}{tbody}{table}\\
{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=571F8866-E3F5-4C1F-BC4F-E88283E9ADBD}{tr:id=name}{td}h6.rowIndex{td}{tr}{tr:id=des}{td}{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_des|text=|trigger=button}{sub-section}{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_des|trigger=none|class=sIndent}Get or set the record index of the dataset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_ret|text=|trigger=button}{sub-section}{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_see|text=|trigger=button}{sub-section}{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_see|text=|trigger=button}{sub-section}{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_sam|text=|trigger=button}{sub-section}{sub-section:571F8866-E3F5-4C1F-BC4F-E88283E9ADBD_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
//to set the rowIndex:
dataset.rowIndex = 1 //sets the rowIndex to the first row (dataset is 1-based)
//to retrieve the rowIndex of the currently selected row
var currRow = dataset.rowIndex
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\
{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD}{tr:id=name}{td}h6.addColumn{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}addColumn{span}{span:id=iets|style=float: left;}\(name, index, type){span}{td}{tr}{tr:id=des}{td}{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_des|text=|trigger=button}{sub-section}{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_des|trigger=none|class=sIndent}adds a column with the specified name to the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_prs|trigger=none}name -- column name.
\[index\] -- column index number between 1 and getMaxColumnIndex().
\[type\] -- the type of column, see JSColumn constants.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_ret|text=|trigger=button}{sub-section}{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_ret|trigger=none|class=sIndent}[Boolean] -- true if succeeded, else false.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_see|text=|trigger=button}{sub-section}{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_see|text=|trigger=button}{sub-section}{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_sam|text=|trigger=button}{sub-section}{sub-section:C38ABF0A-7AAF-43C9-9A09-09DC8BA8B4AD_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var success = dataset.addColumn('columnName',1);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DA23D6DE-FE0A-4298-AA9A-DA4445B290C4}{tr:id=name}{td}h6.addHTMLProperty{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addHTMLProperty{span}{span:id=iets|style=float: left;}\(row, col, name, value){span}{td}{tr}{tr:id=des}{td}{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_des|text=|trigger=button}{sub-section}{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_des|trigger=none|class=sIndent}Add an HTML property to an HTML tag produced in getAsHTML().
For row and col parameters use:
1 = applies to the container
0 = applies to all
>0 = applies to specific cell{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_prs|trigger=none}row -- row number
col -- column number
name -- String property name
value -- String property value
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_ret|text=|trigger=button}{sub-section}{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_see|text=|trigger=button}{sub-section}{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_see|text=|trigger=button}{sub-section}{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_sam|text=|trigger=button}{sub-section}{sub-section:DA23D6DE-FE0A-4298-AA9A-DA4445B290C4_sam|class=sIndent|trigger=none}{code:language=javascript}
//adds a container property (to TABLE tag)
dataset.addHTMLProperty(-1,-1,'cellspacing','3');
//adds a row property to all rows (to TR tag)
dataset.addHTMLProperty(0,0,'class','text');
//adds a row property to second row (to TR tag)
dataset.addHTMLProperty(2,0,'class','text');
//adds a column property to all 3rd columns (to TD tag)
dataset.addHTMLProperty(0,3,'class','redcolumn') ;
//adds a specific cell property (to TD tag)
dataset.addHTMLProperty(2,4,'color','blue');
globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=4D327412-96F3-48DB-82C3-04467E67FE07}{tr:id=name}{td}h6.addRow{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addRow{span}{span:id=iets|style=float: left;}\(index, array){span}{td}{tr}{tr:id=des}{td}{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_des|text=|trigger=button}{sub-section}{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_des|trigger=none|class=sIndent}Add a row to the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_prs|trigger=none}\[index\] -- index to add row (1-based), add by default as last row
array -- row data
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_ret|text=|trigger=button}{sub-section}{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_see|text=|trigger=button}{sub-section}{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_see|text=|trigger=button}{sub-section}{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_sam|text=|trigger=button}{sub-section}{sub-section:4D327412-96F3-48DB-82C3-04467E67FE07_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
dataset.addRow(new Array(1,2,3,4,5,6,7,7)); //adds a row with 8 columns
dataset.addRow(2, new Array(1,2,3,4,5,6,7,7)); //adds a row with 8 columns after row 2
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=4702F7EA-8337-4D07-9373-F497CD5FD95E}{tr:id=name}{td}h6.createDataSource{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}createDataSource{span}{span:id=iets|style=float: left;}\(name, types){span}{td}{tr}{tr:id=des}{td}{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_des|text=|trigger=button}{sub-section}{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_des|trigger=none|class=sIndent}Create a data source from the data set with specified name and using specified types.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_prs|trigger=none}name -- data source name
\[types\] -- array of types as defined in JSColumn, when null or not supplied types are inferred from the data if possible.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_ret|text=|trigger=button}{sub-section}{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_ret|trigger=none|class=sIndent}[String] -- String uri reference to the created data source.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_see|text=|trigger=button}{sub-section}{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_see|text=|trigger=button}{sub-section}{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_sam|text=|trigger=button}{sub-section}{sub-section:4702F7EA-8337-4D07-9373-F497CD5FD95E_sam|class=sIndent|trigger=none}{code:language=javascript}
ds.addColumn('my_id');
ds.addColumn('my_label');
var uri = ds.createDataSource('mydata', [JSColumn.INTEGER, JSColumn.TEXT]);
var jsform = solutionModel.newForm(fname, uri, null, true, 300, 300);
var query = 'select customerid, address, city, country from customers';
var ds2 = databaseManager.getDataSetByQuery('example_data', query, null, 999);
var uri2 = ds2.createDataSource('mydata2'); // types are inferred from query result
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E}{tr:id=name}{td}h6.getAsHTML{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getAsHTML{span}{span:id=iets|style=float: left;}\(escape_values, escape_spaces, multi_line_markup, pretty_indent, add_column_names){span}{td}{tr}{tr:id=des}{td}{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_des|text=|trigger=button}{sub-section}{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_des|trigger=none|class=sIndent}Get the dataset as an html table.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_prs|trigger=none}\[escape_values\] -- if true, replaces illegal HTML characters with corresponding valid escape sequences.
\[escape_spaces\] -- if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags.
\[multi_line_markup\] -- if true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p>
\[pretty_indent\] -- if true, adds indentation for more readable HTML code.
\[add_column_names\] -- if false, column headers will not be added to the table.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_ret|text=|trigger=button}{sub-section}{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_ret|trigger=none|class=sIndent}[String] -- String html.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_see|text=|trigger=button}{sub-section}{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_see|text=|trigger=button}{sub-section}{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_sam|text=|trigger=button}{sub-section}{sub-section:0CA1ABDA-9BCC-4A20-9A3D-8F8552AF152E_sam|class=sIndent|trigger=none}{code:language=javascript}
//gets a dataset based on a query
//useful to limit the number of rows
var maxReturnedRows = 10;
var query = 'select c1,c2,c3 from test_table where start_date = ?';
//to access data by name, do not use '.' or special characters in names or aliases
var args = new Array();
args[0] = order_date //or new Date();
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()),query,args,maxReturnedRows);
// gets a dataset with escape values; escape spaces (lines will not wrap); no multi-line markup; with pretty indentation; shows column names
var htmlTable = dataset.getAsHTML(true, true, false, true, true);
//assigns the dataset to a field and sets the display type to HTML_AREA
//assuming the html_field is a global text variable
globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
//Note: To display an HTML_AREA field as an HTML page, add HTML tags at the beginning '<html>' and at the end '</html>'.
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=CC050F24-1765-436C-817D-0ECE3D23E9CA}{tr:id=name}{td}h6.getAsText{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getAsText{span}{span:id=iets|style=float: left;}\(column_separator, row_separator, value_delimiter, add_column_names){span}{td}{tr}{tr:id=des}{td}{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_des|text=|trigger=button}{sub-section}{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_des|trigger=none|class=sIndent}Get the dataset as formatted text.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_prs|trigger=none}column_separator -- any specified column separator; examples: tab '\t'; comma ','; semicolon ';'; space ' ' .
row_separator -- the specified row separator; examples: new line '\n'.
value_delimiter -- the specified value delimiter; example: double quote '"'.
add_column_names -- boolean if true column names will be added as a first row.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_ret|text=|trigger=button}{sub-section}{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_ret|trigger=none|class=sIndent}[String] -- String formatted text.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_see|text=|trigger=button}{sub-section}{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_see|text=|trigger=button}{sub-section}{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_sam|text=|trigger=button}{sub-section}{sub-section:CC050F24-1765-436C-817D-0ECE3D23E9CA_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
//you can create csv or tab delimited results
var csv = dataset.getAsText(',','\n','"',true)
var tab = dataset.getAsText('\t','\n','"',true)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=733AF36A-869D-4086-B0BC-0865449E654B}{tr:id=name}{td}h6.getColumnAsArray{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object[]{span}{span:id=iets|style=float: left; font-weight: bold;}getColumnAsArray{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_des|text=|trigger=button}{sub-section}{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_des|trigger=none|class=sIndent}Get the column data of a dataset as an Array.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_prs|trigger=none}index -- index of column (1-based).
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_ret|text=|trigger=button}{sub-section}{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_ret|trigger=none|class=sIndent}Object[] -- Object array of data.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_see|text=|trigger=button}{sub-section}{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_see|text=|trigger=button}{sub-section}{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_sam|text=|trigger=button}{sub-section}{sub-section:733AF36A-869D-4086-B0BC-0865449E654B_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var dataArray = dataset.getColumnAsArray(1); //puts the contents from the first column of the dataset into an array
//once you have it as an array you can loop through it or feed it to a custom valuelist for example
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3697A1F6-7419-46F8-AC7F-45FAEA813DA4}{tr:id=name}{td}h6.getColumnName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getColumnName{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_des|text=|trigger=button}{sub-section}{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_des|trigger=none|class=sIndent}Get a column name based on index.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_prs|trigger=none}index -- index of column (1-based).
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_ret|text=|trigger=button}{sub-section}{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_ret|trigger=none|class=sIndent}[String] -- String column name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_see|text=|trigger=button}{sub-section}{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_see|text=|trigger=button}{sub-section}{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_sam|text=|trigger=button}{sub-section}{sub-section:3697A1F6-7419-46F8-AC7F-45FAEA813DA4_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var firstColumName = dataset.getColumnName(1) //retrieves the first columnname into the variable firstColumName
//using a loop you can get all columnames in an array:
var query = 'select * from customers';
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, null, 100);
var colArray = new Array()
for (var i = 1; i <= dataset.getMaxColumnIndex(); i++)
{
colArray[i-1] = dataset.getColumnName(i)
//note the -1, because an array is zero based and dataset is 1 based.
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F7595D36-83D4-40EC-A1A9-1AF86EF923D2}{tr:id=name}{td}h6.getException{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[ServoyException]{span}{span:id=iets|style=float: left; font-weight: bold;}getException{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_des|text=|trigger=button}{sub-section}{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_des|trigger=none|class=sIndent}Get the database exception if an error occurred.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_ret|text=|trigger=button}{sub-section}{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_ret|trigger=none|class=sIndent}[ServoyException] -- ServoyException exception or null when not available.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_see|text=|trigger=button}{sub-section}{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_see|text=|trigger=button}{sub-section}{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_sam|text=|trigger=button}{sub-section}{sub-section:F7595D36-83D4-40EC-A1A9-1AF86EF923D2_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var dbException = dataset.getException();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=73A8CE89-9793-4784-B455-350C3DCBAD53}{tr:id=name}{td}h6.getMaxColumnIndex{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getMaxColumnIndex{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_des|text=|trigger=button}{sub-section}{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_des|trigger=none|class=sIndent}Get the number of columns in the dataset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_ret|text=|trigger=button}{sub-section}{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_ret|trigger=none|class=sIndent}[Number] -- int number of columns.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_see|text=|trigger=button}{sub-section}{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_see|text=|trigger=button}{sub-section}{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_sam|text=|trigger=button}{sub-section}{sub-section:73A8CE89-9793-4784-B455-350C3DCBAD53_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
for (var i = 1; i <= dataset.getMaxColumnIndex(); i++)
{
colArray[i-1] = dataset.getColumnName(i)
//have to subtract 1, because an array is zero based and a dataset is 1 based.
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6E20CD72-74B0-4981-BE68-5CD893382670}{tr:id=name}{td}h6.getMaxRowIndex{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getMaxRowIndex{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_des|text=|trigger=button}{sub-section}{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_des|trigger=none|class=sIndent}Get the number of rows in the dataset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_ret|text=|trigger=button}{sub-section}{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_ret|trigger=none|class=sIndent}[Number] -- int number of rows.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_see|text=|trigger=button}{sub-section}{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_see|text=|trigger=button}{sub-section}{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_sam|text=|trigger=button}{sub-section}{sub-section:6E20CD72-74B0-4981-BE68-5CD893382670_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var totalRows = dataset.getMaxRowIndex();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=20EC55FD-1533-4D9E-9E40-C57F87A570D5}{tr:id=name}{td}h6.getRowAsArray{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRowAsArray{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_des|text=|trigger=button}{sub-section}{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_des|trigger=none|class=sIndent}Get the row data of a dataset as an Array.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_prs|trigger=none}index -- index of row (1-based).
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_ret|text=|trigger=button}{sub-section}{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_ret|trigger=none|class=sIndent}Object[] -- Object array of data.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_see|text=|trigger=button}{sub-section}{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_see|text=|trigger=button}{sub-section}{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_sam|text=|trigger=button}{sub-section}{sub-section:20EC55FD-1533-4D9E-9E40-C57F87A570D5_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var dataArray = dataset.getRowAsArray(1); //puts the contents from the first row of the dataset into an array
//once you have it as an array you can loop through it
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E728C549-1A4E-4AA6-AF9D-677C1B50F565}{tr:id=name}{td}h6.getValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object{span}{span:id=iets|style=float: left; font-weight: bold;}getValue{span}{span:id=iets|style=float: left;}\(row, col){span}{td}{tr}{tr:id=des}{td}{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_des|text=|trigger=button}{sub-section}{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_des|trigger=none|class=sIndent}Get the value specified by row and column position from the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_prs|trigger=none}row -- row number, 1-based
col -- column number, 1-based
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_ret|text=|trigger=button}{sub-section}{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_ret|trigger=none|class=sIndent}Object -- Object value{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_see|text=|trigger=button}{sub-section}{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_see|text=|trigger=button}{sub-section}{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_sam|text=|trigger=button}{sub-section}{sub-section:E728C549-1A4E-4AA6-AF9D-677C1B50F565_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var dataAtRow2Col1 = dataset.getValue(2, 1);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=871A0FA1-5248-45F0-90CA-2D2D5FBA07FD}{tr:id=name}{td}h6.hadMoreData{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}hadMoreData{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_des|text=|trigger=button}{sub-section}{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_des|trigger=none|class=sIndent}Return true if there is more data in the resultset then specified by maxReturnedRows at query time.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_ret|text=|trigger=button}{sub-section}{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_ret|trigger=none|class=sIndent}[Boolean] -- boolean more data available{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_see|text=|trigger=button}{sub-section}{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_see|text=|trigger=button}{sub-section}{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_sam|text=|trigger=button}{sub-section}{sub-section:871A0FA1-5248-45F0-90CA-2D2D5FBA07FD_sam|class=sIndent|trigger=none}{code:language=javascript}
var ds = databaseManager.getDataSetByQuery('example_data', 'select order_id from orders', null, 10000)
if (ds.hadMoreData())
{
// handle large result
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A9575030-A360-4D71-8325-F4E69E1AEE3E}{tr:id=name}{td}h6.removeColumn{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}removeColumn{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_des|text=|trigger=button}{sub-section}{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_des|trigger=none|class=sIndent}Remove a column by index from the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_prs|trigger=none}index -- index of column to remove (1-based)
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_ret|text=|trigger=button}{sub-section}{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_ret|trigger=none|class=sIndent}[Boolean] -- true if succeeded, else false.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_see|text=|trigger=button}{sub-section}{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_see|text=|trigger=button}{sub-section}{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_sam|text=|trigger=button}{sub-section}{sub-section:A9575030-A360-4D71-8325-F4E69E1AEE3E_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var success = dataset.removeColumn(1); // removes first column
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=08CD996C-41FC-42DE-8567-2C0978D03131}{tr:id=name}{td}h6.removeRow{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeRow{span}{span:id=iets|style=float: left;}\(row){span}{td}{tr}{tr:id=des}{td}{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_des|text=|trigger=button}{sub-section}{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_des|trigger=none|class=sIndent}Remove a row from the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_prs|trigger=none}row -- row index to remove, -1 for all rows
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_ret|text=|trigger=button}{sub-section}{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_see|text=|trigger=button}{sub-section}{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_see|text=|trigger=button}{sub-section}{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_sam|text=|trigger=button}{sub-section}{sub-section:08CD996C-41FC-42DE-8567-2C0978D03131_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
dataset.removeRow(1); //removes the first row
dataset.removeRow(-1); //removes all rows
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E82E7828-3644-49E3-B04A-2D7BDE9AD0EC}{tr:id=name}{td}h6.setValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setValue{span}{span:id=iets|style=float: left;}\(row, col, obj){span}{td}{tr}{tr:id=des}{td}{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_des|text=|trigger=button}{sub-section}{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_des|trigger=none|class=sIndent}Set the value specified by row and column position from the dataset.
Use row = -1, to set columnnames.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_prs|trigger=none}row -- row number, 1-based
col -- column number, 1-based
obj -- the value to be stored at the given row and column.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_ret|text=|trigger=button}{sub-section}{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_see|text=|trigger=button}{sub-section}{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_see|text=|trigger=button}{sub-section}{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_sam|text=|trigger=button}{sub-section}{sub-section:E82E7828-3644-49E3-B04A-2D7BDE9AD0EC_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
dataset.getValue(2, 1,'data');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8F571A1D-EAE4-4B6A-BD37-65600C49DBFB}{tr:id=name}{td}h6.sort{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}sort{span}{span:id=iets|style=float: left;}\(col, sort_direction){span}{td}{tr}{tr:id=des}{td}{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_des|text=|trigger=button}{sub-section}{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_des|trigger=none|class=sIndent}Sort the dataset on the given column in ascending or descending.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_prs|trigger=none}col -- column number, 1-based
sort_direction -- boolean true for ascending, false for descending
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_ret|text=|trigger=button}{sub-section}{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_see|text=|trigger=button}{sub-section}{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_see|text=|trigger=button}{sub-section}{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_sam|text=|trigger=button}{sub-section}{sub-section:8F571A1D-EAE4-4B6A-BD37-65600C49DBFB_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
dataset.sort(1,false)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Cache
index
true
refresh
100d
showRefresh
true
id
doc
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientservoy sSummary12%30%58%height: 30px;3Property SummaryGet or set the record index of the dataset.servoy sSummary12%30%58%height: 30px;3Methods Summaryadds a column with the specified name to the dataset.adds a column with the specified name to the dataset.adds a column with the specified name to the dataset.voidAdd an HTML property to an HTML tag produced in getAsHTML().voidAdd a row to the dataset.voidAdd a row to the dataset.Create a datasource from the data set with specified name and using specified types.Create a datasource from the data set with specified name and using specified types.Create a datasource from the data set with specified name and using specified types.Get the dataset as an html table, do not escape values or spaces, no multi_line_markup, do not add indentation, add column names.Get the dataset as an html table, do not escape spaces, no multi_line_markup, do not add indentation, add column names.Get the dataset as an html table, no multi_line_markup, do not add indentation, add column names.Get the dataset as an html table, do not add indentation, add column names.Get the dataset as an html table, add column names.Get the dataset as an html table.Get the dataset as formatted text.Get the column data of a dataset as an Array.Get a column name based on index.Get the column names of a dataset.Get a column type based on index.Get the database exception if an error occurred.Get the number of columns in the dataset.Get the number of rows in the dataset.Get the row data of a dataset as an Array.Get the value specified by row and column position from the dataset.Return true if there is more data in the resultset then specified by maxReturnedRows at query time.Remove a column by index from the dataset.voidRemove a row from the dataset.voidSet a column name based on index.voidSet the value specified by row and column position from the dataset.voidSort the dataset on the given column (1-based) in ascending or descending.voidSort the dataset using the function as comparator.propertyservoy sDetail2100%height:30px2Property DetailsrowIndexname
adds a column with the specified name to the dataset.
prs
Parameters
sIndentnamecolumn name.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddColumnname
addColumn(name, index)
dessIndent
adds a column with the specified name to the dataset.
prs
Parameters
sIndentnamecolumn name.indexcolumn index number between 1 and getMaxColumnIndex().ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddColumnname
addColumn(name, index, type)
dessIndent
adds a column with the specified name to the dataset.
prs
Parameters
sIndentnamecolumn name.indexcolumn index number between 1 and getMaxColumnIndex().typethe type of column, see JSColumn constants.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddHTMLPropertyname
addHTMLProperty(row, col, name, value)
dessIndent
Add an HTML property to an HTML tag produced in getAsHTML().
For row and col parameters use:
1 = applies to the container
0 = applies to all
>0 = applies to specific cell
sIndentindexindex to add row (1-based)arrayrow dataclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddRowname
addRow(array)
dessIndent
Add a row to the dataset. The row will be added as the last row.
prs
Parameters
sIndentarrayrow dataclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcreateDataSourcename
createDataSource(name)
dessIndent
Create a datasource from the data set with specified name and using specified types.
The types are inferred from the data if possible.
A temporary datasource cannot be removed because once created there may always be forms or relations that refer to it.
When the client exits, all datasources used by that client are removed automatically.
Most resources used by the datasource can be released by deleting all records:
dataset.removeRow(-1) or databaseManager.getFoundSet(datasource).deleteAllRecords()
prs
Parameters
sIndentnamedatasource nameret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcreateDataSourcename
createDataSource(name, types)
dessIndent
Create a datasource from the data set with specified name and using specified types.
A temporary datasource cannot be removed because once created there may always be forms or relations that refer to it.
When the client exits, all datasources used by that client are removed automatically.
Most resources used by the datasource can be released by deleting all records:
dataset.removeRow(-1) or databaseManager.getFoundSet(datasource).deleteAllRecords()
A datasource can be reused if the data has the same signature (column names and types).
A new createDataSource() call will clear the datasource contents from a previous call and insert the current data.
prs
Parameters
sIndentnamedatasource nametypesarray of types as defined in JSColumnret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcreateDataSourcename
createDataSource(name, types, pkNames)
dessIndent
Create a datasource from the data set with specified name and using specified types.
A temporary datasource cannot be removed because once created there may always be forms or relations that refer to it.
When the client exits, all datasources used by that client are removed automatically.
Most resources used by the datasource can be released by deleting all records:
dataset.removeRow(-1) or databaseManager.getFoundSet(datasource).deleteAllRecords()
prs
Parameters
sIndentnamedatasource nametypesarray of types as defined in JSColumn, when null types are inferred from the query resultpkNamesarray of pk names, when null a hidden pk-column will be addedret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetAsHTMLname
getAsHTML()
dessIndent
Get the dataset as an html table, do not escape values or spaces, no multi_line_markup, do not add indentation, add column names.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetAsHTMLname
getAsHTML(escape_values)
dessIndent
Get the dataset as an html table, do not escape spaces, no multi_line_markup, do not add indentation, add column names.
prs
Parameters
sIndentescape_valuesif true, replaces illegal HTML characters with corresponding valid escape sequences.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetAsHTMLname
getAsHTML(escape_values, escape_spaces)
dessIndent
Get the dataset as an html table, no multi_line_markup, do not add indentation, add column names.
prs
Parameters
sIndentescape_valuesif true, replaces illegal HTML characters with corresponding valid escape sequences.escape_spacesif true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags.ret
Get the dataset as an html table, do not add indentation, add column names.
prs
Parameters
sIndentescape_valuesif true, replaces illegal HTML characters with corresponding valid escape sequences.escape_spacesif true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags.multi_line_markupif true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p>ret
Get the dataset as an html table, add column names.
prs
Parameters
sIndentescape_valuesif true, replaces illegal HTML characters with corresponding valid escape sequences.escape_spacesif true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags.multi_line_markupif true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p>pretty_indentif true, adds indentation for more readable HTML code.ret
sIndentescape_valuesif true, replaces illegal HTML characters with corresponding valid escape sequences.escape_spacesif true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags.multi_line_markupif true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p>pretty_indentif true, adds indentation for more readable HTML code.add_column_namesif false, column headers will not be added to the table.ret
sIndentcolumn_separatorany specified column separator; examples: tab '\t'; comma ','; semicolon ';'; space ' ' .row_separatorthe specified row separator; examples: new line '\n'.value_delimiterthe specified value delimiter; null means empty string; example: double quote '"'.add_column_namesif true column names will be added as a first row.ret
Return true if there is more data in the resultset then specified by maxReturnedRows at query time.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowremoveColumnname
removeColumn(index)
dessIndent
Remove a column by index from the dataset.
prs
Parameters
sIndentindexindex of column to remove (1-based)ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowremoveRowname
removeRow(row)
dessIndent
Remove a row from the dataset.
prs
Parameters
sIndentrowrow index to remove, -1 for all rowsclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsetColumnNamename
setColumnName(index, columnName)
dessIndent
Set a column name based on index.
prs
Parameters
sIndentindexindex of column (1-based).columnNamenew column name.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsetValuename
setValue(row, col, obj)
dessIndent
Set the value specified by row and column position from the dataset.
Use row = -1, to set columnnames.
prs
Parameters
sIndentrowrow number, 1-basedcolcolumn number, 1-basedobjthe value to be stored at the given row and column.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsortname
sort(col, sort_direction)
dessIndent
Sort the dataset on the given column (1-based) in ascending or descending.
prs
Parameters
sIndentcolcolumn number, 1-basedsort_directionascending (true) or descending (false)clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsortname
sort(comparator)
dessIndent
Sort the dataset using the function as comparator.
The comparator function is called to compare two rows, that are passed as arguments, and
it will return -1/0/1 if the first row is less/equal/greater then the second row.
NOTE: starting with 7.2 release, when called on datasource(foundset) dataset, this function doesn't save the data anymore