Json data

I have this response in API Server Action

{"api_store_info":{"status":200,"headers":{"0":"HTTP\/1.1 200 OK","Server":"nginx","Date":"Mon, 02 Dec 2019 19:55:49 GMT","Content-Type":"application\/json","Transfer-Encoding":"chunked","Connection":"keep-alive","Vary":"Accept-Encoding","X-Powered-By":"Storeden","Cache-Control":"public","Content-Encoding":"gzip"},"data":{"uid":19674240,"url":"http:\/\/www.decoresin.it","store_name":"Decoresin SRL","currency":"EUR","locale":"it_IT"}}}
How to read I “uid” value or “store_name” value ? I don’t see this value in App Structure !

Hi Mirko,

Have you used the Define API Schema function on the server api action? You can paste your results from above into that in order to establish the ability to select via the UI.

–Ken

yes, I have. This is the Api Server action response

Hmmm. If your Define Schema has the entries under “data” like my example below, then you might try recreating this api action from scratch. If you still can’t see, perhaps a bug report.

this my api schema, it works great

my server action

data bindig

I haven’t json schema !!!

I’ve seen this lately and find that a Wappler restart helps. If you can recreate, then a bug report might help the team.

ok, I restarted, same problem @teodor please, you can read from the beginning of this post to understand my problem. Thanks

this is the result on webpage

text1 - status (it works)
text2 - data (it doesn’t work)

why ?

[Object Object] is generally linked to 2 things.
The obvious one is the object is undefined, the second is the object name is duplicated on the page, check for duplicates.
What is the output if you run the server action directly using the browse server action button?

Ok @Hyperbytes you can see the output in the first line of this conversazione. I don’t have duplicate object or name

Try using:

serverconnect_store_info.data.api_store_info.data.uid
1 Like

ok, it works

why this ?

Because your API returns an object, not an array (As the server actions/other APIs do):

"data":{"uid":19674240,"url":"http:\/\/www.decoresin.it","store_name":"Decoresin SRL","currency":"EUR","locale":"it_IT"}

More about data types:

I have same problem i table generator. My json response is:

{"api_product_list":{"status":200,"headers":{"0":"HTTP\/1.1 200 OK","Server":"nginx","Date":"Tue, 03 Dec 2019 10:46:45 GMT","Content-Type":"application\/json","Transfer-Encoding":"chunked","Connection":"keep-alive","Vary":"Accept-Encoding","X-Powered-By":"Storeden","Access-Control-Allow-Origin":"*","Cache-Control":"public","Content-Encoding":"gzip"},"data":[{"uid":19674246,"price":11.5,"final_price":9.76,"code":"002000","status":1},{"uid":19674253,"price":10,"final_price":7.93,"code":"001000","status":1},{"uid":20044732,"price":22,"final_price":20.13,"code":"002006","status":1},{"uid":20044791,"price":5,"final_price":5,"code":"002000S","status":0},{"uid":20052983,"price":4,"final_price":4,"code":"001000S","status":0},{"uid":20058635,"price":22,"final_price":20.13,"code":"002011","status":1},{"uid":20065863,"price":18.5,"final_price":16.47,"code":"002001","status":1},{"uid":20065885,"price":18.5,"final_price":16.47,"code":"002002","status":1},{"uid":20065893,"price":18.5,"final_price":16.47,"code":"002003","status":1},{"uid":20065898,"price":18.5,"final_price":16.47,"code":"002008","status":1},{"uid":20065900,"price":22,"final_price":20.13,"code":"002012","status":1},{"uid":20065902,"price":22,"final_price":20.13,"code":"002010","status":1},{"uid":20065907,"price":22,"final_price":20.13,"code":"002005","status":1},{"uid":20065915,"price":19.5,"final_price":18.3,"code":"001009","status":1},{"uid":20065924,"price":19.5,"final_price":18.3,"code":"001010","status":1},{"uid":20065929,"price":19.5,"final_price":18.3,"code":"001012","status":1},{"uid":20065943,"price":19.5,"final_price":18.3,"code":"001013","status":1},{"uid":20065975,"price":19.5,"final_price":18.3,"code":"001007","status":1},{"uid":20066082,"price":19.5,"final_price":18.3,"code":"001011","status":1},{"uid":20066103,"price":15.5,"final_price":13.42,"code":"001003","status":1},{"uid":20066130,"price":15.5,"final_price":13.42,"code":"001004","status":1},{"uid":20066133,"price":15.5,"final_price":13.42,"code":"001006","status":1},{"uid":20066154,"price":15.5,"final_price":13.42,"code":"001008","status":1},{"uid":20066158,"price":15.5,"final_price":13.42,"code":"001005","status":1}]}}
How to can I populate my tables ?
I tryed

serverconnect_product_list.data.api_product_list.data

but it doesn’t work
this is the error

thanks

@DecoresinSrl
Do you have any test API credentials to send me in a personal message so i can check what is it generating and what is going on.

ok thanks

1 Like