ListGetJSON(ListboxName As String) As String

 

Retrieves the contents of a imListbox into an array-like JSON string.

 

JSON is a lightweight data exchange format. It is described at http://json.org. It is based on the Javascript language.

 

The JSON methods used with ListGetJSON operate on JSONItems as arrays

and cannot be mixed with JsonCreate functions.

 

(The internal JSON object is of Xojo type JSONItem [classic Xojo framework])

 

Parameters:

 

Name

Type

Description

ListboxName

String

ScreenFieldName of the listbox to fill with contents.

Ctrl+Click onto a listbox to retrieve its ListboxName

(= ScreenFieldName).

 

Returns:

 

Type

Value

Description

String

listbox

contents

An array like JSON string with contents from the listbox ListboxName.

See ListSetJSON for how to generate a Json string from the contents of a listbox.

 

Each row is enclosed in brackets

Columns are separated by commas

The whole dataset is enclosed again in brackets

 

Example JSON string:

"[[""2015-05-18"",""PayPal"",""5.00""],[""2016-05-18"",""PayPal"",""15.00""]]"

 

 

Available in:

 

WindowMain

WindowLink

YES

YES

 

Hint: You can find references to XojoScripts which make use of this function by sending the following SQL statement to the database:

Select id,GUID, ScriptName,ScriptCode from im_scripts where ScriptCode Like '%ListGetJSON%'

 

Example XojoScript:

 

// Retrieve listbox data as a JSON string

Dim jsn1 As String = ListgetJSON("imLB_lnk_p01_PaymentList")

 

// Show json string

// For instance: [["2015-05-18","PayPal","5.00"]]

MsgBox(jsn1)

 

// Fill a listbox from a array-like json string

// each row is enclosed in brackets

// columns are separated by commas

// the whole dataset is enclosed again with brackets

Dim jsn2 As String = "[[""2015-05-18"",""PayPal"",""5.00""],[""2016-05-18"",""PayPal"",""15.00""]]"

 

ListSetJSON("imLB_lnk_p01_PaymentList",jsn2)