Cannot Separate API arrays


#1

I tried calling an API, but it seems to not be able to either separate the 2 sets of values. At least it will not allow me to click on the 2nd set. I need to be able to separate the 2 sets of values to be put into different tables.


Display API data with nested arrays
#2

You need to enclose static text values in single quotes.

so just enter ‘USD’


#3

Sorry, already changed the question. There are 2 sets of values, bids and asks, each with it’s own two sets of datapoints. However, when fetching schema, I can’t click the 2nd one as it thinks they’re the same thing.vI need to rename them into different variable sets.


#4

Also, on that subject again, how do I pass through a variable. I tried putting single quotes around the variable ID, it just pushes the variable ID into the API. I tried putting single quotes around the declared value of the variable ID and it shows nothing in the API.


#5

Yeap problem is returning smilar array name. Wappler doesnt allow to click on second name.
Maybe you can make short video . It more clear


#6

There quite a few issues and I have been trying for days to do a simple API call and then display it correctly. I’m trying to pull an orderbook from an exchange. The API call returns:

{
“lastUpdateId”: 475408718,
“bids”: [
[
“0.03414800”,
“27.36900000”
],
[
“0.03414600”,
“0.04300000”
],
[
“0.03414500”,
“10.49200000”
],
[
“0.03414400”,
“15.80000000”
],
[
“0.03414300”,
“2.28200000”
]
],
“asks”: [
[
“0.03415500”,
“7.74400000”
],
[
“0.03415600”,
“8.00000000”
],
[
“0.03415900”,
“0.43900000”
],
[
“0.03416000”,
“4.00000000”
],
[
“0.03416200”,
“6.00000000”
]
]
}

where there are BIDS and there are ASKS. The first number is the price, the 2nd number is the amount . When using client side fetch schema, it returns $value (bids/asks) as an array and then another $value as a text variable that holds both the price and the amount. First frustration is how can I display just the BIDS or just the ASKS into a repeatable structure (such as a table) to show bids.price and the bids.mount and then on another structure the same for ASKS. The only time, I can get a table to show the results if I just use api.data, which just shows all in 2 rows. If I try to just get the BIDS or ASKS, it shows nothing. Second frustration comes to why can’t I select and change the second $value (ASKS)? It just thinks they’re all the same type when it isn’t at all.

Another issue is when I try to run the exact same API call, which does actually pull data on client side, on the server side, it keeps saying one of the parameters is incorrect or null, etc even though it is exactly the same as client side. Why is that happening?


assigned George #7

#8

This has been fixed in the Wappler 1.9.6


#9

I see that. Thank you.


#10

Question, was server side api calling fixed? The part I mentioned that it doesn’t run the api saying a parameter value is null or invalid even though the setup is exactly the same as running on client side, which does work.


#11

you can check if it is fixed and otherwise post separate topic as it seems a totally different issue to me


closed #12

archived #13

unlisted #14

unassigned George #15