GetLocalDataTable
public string GetLocalDataTable(string chartKey);
Parameter
Value | Type | Description |
---|---|---|
chartKey | String | The chart name, chart name specified by GetTableContentAndLocalSave or the chart ID may have different parameter values depending on which Key type they were saved through. |
Description
Calls the chart file saved locally.
The value stored locally is the data of the Excel file uploaded from the chart management section of BACKND Console.
The method is returned as a string, and only synchronous types are supported.
Example
Synchronous
Backnd.DataTable.GetLocalDataTable("chartKey");
Return cases
When the corresponding chartKey exists locally
The content of the chart is returned in the form of a string.
Please see below for the return format.
When the corresponding chartKey does not exist locally
string.empty is returned.
When the chartKey is given as null or an empty string
The 'chartKey must not be null or empty' exception is thrown.
Locally saved chart format
{
rows:
[
{
column1:{
S:"68a8b0f0-d336-11e7-8b06-4fc22765a737"
},
column2:{
S:"123123"
},
num:{
S:"1"
}
}
.......
]
}
How to use the called values
The stored value is a string in JSON format. It needs to be converted to a JsonObject for use.
BACKND uses BACKND.LitJson, but you may use others.
BACKND.LitJson.JsonData chartJson = JsonMapper.ToObject(Backnd.DataTable.GetLocalDataTable(DataTableName));
var rows = chartJson["rows"];
// DataTable length
Debug.Log(rows.Count);
// Read the content of column1 of the 10th row in the chart
Debug.Log(rows[10]["column1"]["S"].ToString());