Smartsite SXML CopyCode image Copy Code
{buffer.set(mytable, datatable.createempty(Phone, Model, Price))}
{datatable.rows.add(mytable, Nokia, 6200, 120.99)}
{datatable.rows.add(mytable, Samsung, G600, 299.99)}
{datatable.rows.add(mytable, SonyEricsson, W910, 199.99)}

Nokia is on row {datatable.findone($mytable, "Phone='Nokia'")}
Cheap phones are:
{datatable.simpleformat(datatable.search($mytable, 'Price ' + char.lt() + '= 199.99'))}

Retrieve an individual field:
{datatable.getvalue($mytable, datatable.findone($mytable, "Phone='Samsung'"), 'Model')}

Handle not found:
{datatable.getvalue($mytable, datatable.findone($mytable, "Phone='HTC'", default=null), 'Model', default='(Phone not found)')}
Example Result CopyCode image Copy Code
Nokia is on row 1
Cheap phones are:
Phone=Nokia; Model=6200; Price=120.99
Phone=SonyEricsson; Model=W910; Price=199.99

Retrieve an individual field:
G600

Handle not found:
(Phone not found)
SXML