Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I created a C# app, which can create a dataset I define via json format inside my PowerBI workspace. This works fine, if I create a dataset, which has only one table like the following:
string datasetJson = "{\"name\":\"TestSeveralTables\",\"defaultMode\":\"Push\",\"tables\": " +
"[{\"name\":\"ABC1\",\"columns\": [{\"name\":\"abc_abc1\",\"dataType\":\"string\"}, " +
"{\"name\":\"value_abc1\",\"dataType\":\"Int64\"}, " +
"{\"name\":\"time_abc1\",\"dataType\":\"DateTime\"}]}]}";
However if I want to create a dataset with two or more tables I get a server error 400. My datasetJson string for multiple tables looks as follows:
string datasetJson = "{\"name\":\"TestSeveralTables\",\"defaultMode\":\"Push\",\"tables\": " +
"[{\"name\":\"ABC1\",\"columns\": " +
"[{\"name\":\"abc_abc1\",\"dataType\":\"string\"}," +
"{\"name\":\"value_abc1\",\"dataType\":\"Int64\"}, " +
"{\"name\":\"time_abc1\",\"dataType\":\"DateTime\"}]}]}" +
"[{\"name\":\"ABC2\",\"columns\": " +
"[{\"name\":\"abc_abc2\",\"dataType\":\"string\"}, " +
"{\"name\":\"value_abc2\",\"dataType\":\"Int64\"}, " +
"{\"name\":\"time_abc2\",\"dataType\":\"DateTime\"}]}]}";
What am I doing wrong here? Thanks in advance. Best regards.
Solved! Go to Solution.
Hi. You need to seperate tables with comma.
{
"name": "SalesMarketing",
"defaultMode": "Push",
"tables": [
{
"name": "Table1",
"columns": [
{ "name": "ProductID", "dataType": "Int64" }
]
},
{
"name": "Table2",
"columns": [
{ "name": "ProductID", "dataType": "Int64" }
]
}
]
}
Hi. You need to seperate tables with comma.
{
"name": "SalesMarketing",
"defaultMode": "Push",
"tables": [
{
"name": "Table1",
"columns": [
{ "name": "ProductID", "dataType": "Int64" }
]
},
{
"name": "Table2",
"columns": [
{ "name": "ProductID", "dataType": "Int64" }
]
}
]
}
User | Count |
---|---|
16 | |
5 | |
2 | |
1 | |
1 |
User | Count |
---|---|
22 | |
3 | |
3 | |
2 | |
1 |