Hi, if i want to make this json “GetArray From JSONObjecy” ? how can i do, thanks a lot.
First block in intialize list of articles is GetJSONobject from array, you have objects in array.
Thank your answer, but there have not value inside the array, before i always have a key
like this
keyname:"[
{
“date_id_from”: 20190101,
“date_id_to”: 20191231,
“cluster”: “Hong Kong East Cluster”,
“specialty”: “Ear, Nose, Throat”,
“Category”: “Urgent Case - Median”,
“Description”: “Median Waiting Time for New Case Booking for Specialist Out-patient Services”,
“Value”: “Less than 1 week”
},
{
but this hadn’t the keyname, so i have not input any name in the block (circle on the photo)
i think maybe this get the problem, but i don’t know how to fix it…
This is incorrect it shild be
{
“Keyname” :[
…
]
}
Like this you have converted array to string
Thanks, but the raw json data hadn’t the keyname from the API provider,
(missed keyname here) :[
if like this structure, how can i use “GetArray From JSONObjecy”, thanks.
Simple if your json is in this format
[
{}
]
Then use get json objects in array
And then you get objects and use key of objects to get value
Like first time you get 1st object and use key data_id_from to get value
I see, thanks a lot
Did it works
Still hadn’t try, i will try when i back to office, thanks a lot
Still cannot, anyway, thanks your help
What error or data you are getting in intialize block
There have not any error got, at last, i try to use join function to complete the json structure, it’s done now, thanks so much.
Hi @Jiko_Wong!
Welcome to the community!
As the data from the API is already structured as a JSON Array, you shouldn’t need the initialize local listOfArticles
as you’ve shown in the blocks.
Inside the for loop
, in the Get JSONObject From JSONArray
block, you can directly use the get global newsApiResponse
(assuming that the newsApiResponse
holds the data in the format you have shown here) instead of get listOfArticles
and that should work.
I’ve attached a sample procedure for iterating over a JSON Array.
(The data I have used is from https://jsonplaceholder.typicode.com/posts which is also the same format as yours)
Hope this helps.
Please feel free to reach out incase you have any more queries.
Thanks a lot, it 's very useful