HELP!

encodeData

This method returns a JSON string containing the values of the specified Objects and/or Objects captured during this inference session up to this point This string is typically stored and can be used to restore the Object value at a later session using the decodeData method.

xpertrule.encodeData(ObjectIDs, includeCaptured, encodeType);

ObjectIDs

An array of IDs of specified Object to be encoded in the string [objId1, objId2, objId3]. Can be set to null if no specific objects are required.

includeCaptured

If this is set to true then all Captured objects thus far are included in the encoded string.

encodeType

Currently only possible value is "json" (other formats may be added in future).

An example of using this method:

var dataStr = xpertrule.encodeData(null, true, "json");

An example of the returned JSON string is as follows:

{
	"test_type": {
		"_value": "capturedObjects"
	},
	"my_text_question": {
		"_value": "hello world"
	},
	"my_numeric_question": {
		"_value": 1
	},
	"my_list_question": {
		"_value": ["V1"]
	},
	"my_date_question": {
		"_value": "20190131"
	},
	"my_bool_question": {
		"_value": "Yes"
	},
	"my_password_question": {
		"_value": "djfgfd342"
	}
}

On This Page