Skip to main content
Version: SDK-5.11.2

GetChartListByFolderV2

public BackendReturnObject GetChartListByFolderV2(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 GetChartListByFolder

There are a few differences between this method and GetChartListByFolder.

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

Following the 2023.03.28 update, developers may now create up to 2 game operation policies.

Check the following when migrating from the GetChartListByFolder() method to the GetChartListByFolderV2() 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;
Backend.Chart.GetChartListByFolderV2(folderId);

Asynchronous

int folderId = 0;

Backend.Chart.GetChartListByFolderV2(folderId, (callback) => {
// Post-process
});

SendQueue

int folderId = 000;

SendQueue.Enqueue(Backend.Chart.GetChartListByFolderV2, folderId, (callback) => {
// Post-process
});

Return cases

Success cases

When the lookup is successful
statusCode : 200
message : Success returnValue : refer to GetReturnValuetoJSON

Error cases

When an invalid folder Id is entered
statusCode : 404
errorCode : NotFoundException
message : Chart folder({entered Folder ID}) not found, Chart folder({entered Folder ID}) cannot be found

When the chart does not exist in the folder
statusCode : 404
errorCode : NotFoundException
message : Chart list not found, Chart list cannot be found

GetReturnValuetoJSON

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

Sample code

public class ChartCardV2 {
public string chartName; // Chart name
public string chartExplain; // Chart description
public int selectedChartFileId;// Chart file ID

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

var bro = Backend.Chart.GetChartListByFolderV2(folderId);

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

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

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

ChartCardV2 chartCard = new ChartCardV2();
chartCard.chartName = json[i]["chartName"].ToString();
chartCard.chartExplain = json[i]["chartExplain"].ToString();
chartCard.selectedChartFileId= json[i]["selectedChartFileId"].ToString();

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