Problem with remote dataset JSON

Here’s my result from test url

{
   "entries": [
      {
         "wifi": "GuestAP",
         "rows": {
            "tglAwal": "7 Mei 2018",
            "tglAkhir": "13 Mei 2018",
            "password": "WifiPass100"
         }
      }
   ],
   "number": 1,
   "processed": [
      [
         {
            "Tanggal Awal": "tglAwal",
            "Tanggal Akhir": "7 Mei 2018"
         },
         {
            "Tanggal Awal": "tglAkhir",
            "Tanggal Akhir": "13 Mei 2018"
         },
         {
            "Tanggal Awal": "password",
            "Tanggal Akhir": "WifiPass100"
         }
      ]
   ],
   "messages": [
      "Processing 1 results into 3 potential columns",
      "Processing Result with Data Root rows",
      "DataRoot is an object",
      "Processing as Multiple Rows",
      "Processing tglAwal",
      "Processing tglAkhir",
      "Processing password",
      "Consolidating entries",
      "There are 3 entries in total"
   ]
} 

I have tried to make Data root to rows but still the fetch was not as expected.

I expect that the dataset return only 1 row, but as you can see, it was processed to 3 rows.

DId i miss something here?

Still no luck so far, i couldn’t make it right.

Here’s my dataset column setting

I think i already put it right for the column data setting.

==

One more thing, i also tried to catch the credential username and password using $_POST , but the array is empty.

So how do i catch those variables?

My CMS is v.1.8.9 using docker.

Hello!
If I understood correctly, your JSON will understand 2 colomns only : one with “tglAwal”, “tglAkhir” and “password” and another with “7 Mei 2018”, “13 Mei 2018” and “WifiPass100”.

Like this example : Data Set -> Remote data source

If you want 3 colomns, perhaps the JSON will be rather :

{
“wifi”: “GuestAP”,
“rows”: [
{“tglAwal”: “7 Mei 2018”},
{“tglAkhir”: “13 Mei 2018”},
{“password”: “WifiPass100”}
]
}

And to edit Colomn, in Remote Data Path you should write juste tglAwal, tglAkhir or password.

I don’t know if it’s what you want, but it’s like this that I successed.

Indeed json in that format might not be correctly understood there.

You could have it as an array like here Remote Dataset - Trouble configuring Remote Data Path

so say something like this in json.

 {
         "wifi": "GuestAP",
         "rows":[
		{
            "tglAwal": "7 Mei 2018",
            "tglAkhir": "13 Mei 2018",
            "password": "WifiPass100"
		},
		{
			"tglAwal": "15 Mei 2018",
            "tglAkhir": "23 Mei 2018",
            "password": "WifiPass122"
		}
    ]
 }

3 columns with the remote data path corresponding to the names in .json ie
tglAwal, tglAkhir and password for your 3 columns.

data root in dataset would be rows as well as in the other example and the processed data should be

 "processed": [
      [
         {
            "tglAwal": "7 Mei 2018",
            "tglAkhir": "13 Mei 2018",
            "password": "WifiPass100"
         },
         {
            "tglAwal": "15 Mei 2018",
            "tglAkhir": "23 Mei 2018",
            "password": "WifiPass122"
         }
      ]
   ],

I tried again, and this time i copied the example JSON above and compress it using jsonlint ,
here’s the result

Then i try to call it using postman :

I think, so far so good, then i try to recreate the DataSet :

But then when i try to test the data url , here’s the result :

Here’s the complete response from xibo :

{
   "entries": [
      {
         "wifi": "GuestAP",
         "rows": [
            {
               "tglAwal": "7 Mei 2018",
               "tglAkhir": "13 Mei 2018",
               "password": "WifiPass100"
            },
            {
               "tglAwal": "15 Mei 2018",
               "tglAkhir": "23 Mei 2018",
               "password": "WifiPass122"
            }
         ]
      }
   ],
   "number": 1,
   "processed": [
      [
         [],
         []
      ]
   ],
   "messages": [
      "Processing 1 results into 3 potential columns",
      "Processing Result with Data Root rows",
      "DataRoot is an array",
      "Processing 0",
      "Processing 1",
      "Consolidating entries",
      "There are 2 entries in total"
   ]
}

Any idea , did i miss something here?

The remote data path is incorrect.

As I mentioned it should be tglAwal, tglAkhir, password instead of what you currently have ie 0,1,2

Ahh yes, thank you, i just missed that point,
Don’t know why i put those numbers, maybe i missed read something that i have to put relative number there.

Thank you Peter, it solved now…

1 Like

pak riopangeran apakah masalah datasetnya sudah beres?? mohon info nya dunk…