Skip to main content
Version: SDK-5.9.6

GetChartListByFolder

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

Example

Synchronous

int folderId = 000;
Backend.Chart.GetChartListByFolder(folderId);

Asynchronous

int folderId = 000;

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

SendQueue

int folderId = 000;

SendQueue.Enqueue(Backend.Chart.GetChartList, 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:
[
// version 1(old)
// When selectedChartFile does not exist
{
// Chart uuid
uuid: { S: "538b3a20-7b7a-11e8-8002-f31a1dd37719" },
// Chart indate
inDate: { S: "2018-06-29T08:56:35.266Z" },
// Chart description
chartExplain: { S: "2" },
// Chart name
chartName: { S: "v1" },
// version information(y: version1, n: version2)
old: { S: "y" }
},
// version 1(old)
// When selectedChartFile exists
{
// File information applied to the chart
selectedChartFile:
{
M:
{
// Number of rows in the chart
count: { N: "1000" },
// Chart file uuid
uuid: { S: "780932f0-75fb-11e8-bf7a-cbcc37090d69" },
// Chart file indate
inDate: { S: "2018-06-22T09:05:54.591Z" },
// Chart file name
chartFileName: { S: "222222.xlsx" }
}
},
// Chart indate
inDate: { S: "2018-06-22T09:05:38.562Z" },
// Chart uuid
uuid: { S: "6e7b5e20-75fb-11e8-bf7a-cbcc37090d69" },
// Chart description
chartExplain: { S: "v1" },
// Chart name(used when saving the chart content for selectedChartFile to PlayerPrefs)
chartName: { S: "23" },
// version information(y: version1, n: version2)
old: { S: "y" }
},
// version 2(new)
// When selectedChartFile does not exist
{
// Chart name
chartName: { S: "gggg" },
// Chart description
chartExplain: { NULL: true },
// Applied chart file id(if non-existent)
selectedChartFileId: { NULL: true },
// version information(y: version1, n: version2)
old: { S: "n" }
},
// version 2(new)
// When selectedChartFile exists
{
// Chart name
chartName: { S: "Heyhey" },
// Chart description
chartExplain: { NULL: true },
// Applied chart file id(if present)
selectedChartFileId: { N: "47" },
// version information(y: version1, n: version2)
old: { S: "n" }
}
]
}

Sample code

public class ChartCard {
public bool isChartUpload = true; //Whether the chart is applied(value does not exist in returnValue)
public string chartName; // Chart name
public string chartExplain; // Chart description
public int selectedChartFileId;// Chart file ID
public string old; // Whether it is a new version

public override string ToString() {
return $"chartName: {chartName}\n" +
$"chartExplain: {chartExplain}\n" +
$"isChartUpload: {isChartUpload}\n" +
$"selectedChartFileId: {selectedChartFileId}\n" +
$"old: {old}\n";
}
}

public void GetChartListByFolder() {
int folderId = 343;

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

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

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

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

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

int outNum = 0;
if(int.TryParse(json[i]["selectedChartFileId"].ToString(), out outNum)) {
chartCard.isChartUpload = true;
chartCard.selectedChartFileId = outNum;
}
else {
chartCard.isChartUpload = false;
chartCard.selectedChartFileId = 0;
}

chartCard.old = json[i]["old"].ToString();
chartCardList.Add(chartCard);
}
foreach(var chartCard in chartCardList) {
Debug.Log(chartCard.ToString() + "\n");
}
}