GetTableListByFolder
public BackndReturnObject GetTableListByFolder(int folderId);
Description
Looks up all charts under the specified folder.
A chart is data from the Excel file uploaded to and applied in the chart management section of BACKND Console.
Upon lookup, the chart name, chart ID/UUID, and the chart's version are returned, and chart data is not included.
How to check chart folder ID
The folderId used as the parameter value can be checked through the ID in the chart folder in BACKND Console.
Differences with GetTableListByFolder
There are a few differences between this method and GetTableListByFolder.
- DataTables where files cannot be applied are excluded
- JSON return values do not have the 'old' column.
Following the 2023.03.28 update, developers may now create up to 2 game operation policies.
Check the following when migrating from the GetTableListByFolder() method to the GetTableListByFolder() 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
int folderId = 0;
Backnd.DataTable.GetTableListByFolder(folderId);
Asynchronous
int folderId = 0;
Backnd.DataTable.GetTableListByFolder(folderId, (callback) => {
// Post-process
});
Return cases
Success cases
When the lookup is successful
statusCode : 200
returnValue : refer to GetReturnValuetoJSON
Error cases
When an invalid folder Id is entered
statusCode : 404
errorCode : NotFoundException
When the chart does not exist in the folder
statusCode : 404
errorCode : NotFoundException
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 GetTableListByFolderTest() {
int folderId = 343;
var bro = Backnd.DataTable.GetTableListByFolder(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");
}
}