Skip to main content
Version: 6.0.0

GetTableListByFolderAndLocalSave

public BackndReturnObject GetTableListByFolderAndLocalSave(int folderId, bool isDataTableKeyIsName);

Parameters

ValueTypeDescription
folderIdintDataTable folder ID
isDataTableKeyIsNameboolWhether to use the chart name as the key value of the chart to be saved

true : Use the chart name specified in BACKND Console as the key value
false : Use the chart's {uuid/id} as the key value

Description

Calls and saves all chart file content under the specified folder created in BACKND Console's chart management.

  • Depending on the parameters entered, the chart ID or the chart name set in BACKND Console is applied as the key.
  • The content of the currently applied chart file is saved as the value.
  • If there is no currently applied chart, it will not be saved.

Differences with GetDataTableByFolderAndSave

There are a few differences between this method and GetDataTableByFolderAndSave().

  • DataTables where files cannot be applied are excluded
  • JSON return values do not have the 'old' column.
Note on migration from GetDataTableByFolderAndSave

Check the following when migrating from the GetDataTableByFolderAndSave() method to the GetTableListByFolderAndLocalSave() method:

  • If 'old' is used for parsing JSON(e.g., json["rows"][0]["S"]["old"].ToString())
  • If there is a logic for charts without files applied

Example

Synchronous

Backnd.DataTable.GetTableListByFolderAndLocalSave(1024, true);

Asynchronous

Backnd.DataTable.GetTableListByFolderAndLocalSave(1024, true, callback =>
{
// Post-process
});

Return cases

Success cases

When the lookup is successful
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

GetReturnValuetoJSON

{
rows:
[
{
// DataTable name
chartName: { S: "Monster chart" },
// DataTable description
chartExplain: { NULL: true },
// Applied chart file id
selectedDataTableFileId: { N: "47" },
},
{
chartName: { S: "ItemDataTable" },
chartExplain: { S: "This chart has item information." },
selectedDataTableFileId: { N: "47333" },
}
]
}

Sample code

public class DataTableFile {
public string chartName; // DataTable name
public string chartExplain; // DataTable description
public int selectedDataTableFileId;// DataTable file ID

public override string ToString() {
return $"chartName: {chartName}\n" +
$"chartExplain: {chartExplain}\n" +
$"selectedDataTableFileId: {selectedDataTableFileId}\n";
}
}
public void GetTableListByFolderAndLocalSaveTest() {
int folderId = 343;

var bro = Backnd.DataTable.GetTableListByFolderAndLocalSave(folderId);

if(!bro.IsSuccess()) {
Debug.LogError("An error occurred : " + bro.ToString());
return;
}

List<DataTableFile> chartCardList = new List<DataTableFile>();

BACKND.LitJson.JsonData json = bro.FlattenRows();
for(int i = 0; i < json.Count; i++) {

DataTableFile chartCard = new DataTableFile();
chartCard.chartName = json[i]["chartName"].ToString();
chartCard.chartExplain = json[i]["chartExplain"].ToString();
chartCard.selectedDataTableFileId= json[i]["selectedDataTableFileId"].ToString();

chartCardList.Add(chartCard);
}
foreach(var chartCard in chartCardList) {
Debug.Log(chartCard.ToString() + "\n");
}
}