Select list item List index to large am looking for a simple solution for my stupid problem ^^

Hello,

I want to call an API that is not static.
https://mempool.space/api/v1/fees/mempool-blocks


As a rule, list number 1 is always present, with list 2 and list 3 it is different.
These are only available when a block is being filled.

So my attempt it is now easy to say, Hey web1 and web2 if you find nothing there then there is nothing and set text empty.
Here is my build

I searched and tried alot but nothing work, someone has a clue ? :slight_smile:

Greez

You could use dictionary blocks, a small example

1 Like

im getting a error message

is there no simplier way ?

It would be enough if I suppress the error message, sometimes the api's are offline for a short time, then error messages come up all the time

You could use response code so when got text from web if response code is 200 then ...

1 Like

uhm do i need to name all the intialize globals ?

Yes if you wish to use all info's

hello it's me again, i still have the problem. I'll show you what I'm up to :slight_smile:

maybe you can help me better then.

I waited until there were enough blocks in the mempool and was able to test for a few hours until the following message came up - Selected list item: List index too large
because only 1 "block" is available for the called api

[{"blockSize":172867,"blockVSize":113710,"nTx":351,"totalFees":1624806,"medianFee":4.106951871657754,"feeRange":[1.004566210045662,2.6178489702517163,3.1008849557522122,4.013937282229965,4.2437768240343345,6.387096774193548,21.047027506654835,343.64261168384877]}]


Affected blocks expanded and the picture to it


yes all look like this ^^

What I would like now is if the build does not receive a response because the list is empty, these "blocks" marked in red should simply disappear, (it can be that one of the two still remains) without generating an error message.

can this be implemented as in your build above, as shown in the picture, or maybe some other solution? suppress error message(i tried to set the "error ocurred" event into build, but nothing changed)

is there no way like, if get response content error set label text 0 (e.g.)

I'm a bit careful about rushing on your build, don't get me wrong, because it is a lot of work :smiley:

greez

ListViews and List Pickers are good ways of displaying variable numbers of items.
Code a value function to take a block object and return a multi-line text item suitable for display (YAML?), and fill the ListView Elements from the list of text items.

1 Like

do you mean how dora_paz explained it?

is it possible to display more data in one label like in my previous build with join text or do i need for each item a seperat label ?
image

i dont get it ....

I only get the first one displayed above and Join text or something similar doesn't work either ...

A couple of examples for what I believe you want to do:

1 Like

Unfortunately, you have not provided any source code that could be loaded into AI2.

oe second im testing, i give you the aia

there it is, it showing me now this, but its not working like this https://mempool.space/de/
testttttt.aia (19.7 KB)

one by one should disappear or appear


do i need to add this, yellow marked?
image

lol, finally i got it... thank u so much all here @ABG @dora_paz @TIMAI2



1 Like

I couldn't let you leave without showing you how much code you could eliminate using value procedures:

testttttt_ABG.aia (4.8 KB)

P.S. Your blocks diagram looked like you trained at the Collyer Brothers code school.

1 Like

oh wow thank you very much.... i need to look what you meen with Collyer Brothers, didnt know that ^^

to be honest, i'm quite a beginner, this part of the app was the most annoying for me i didn't know how to do it, i'm grateful that there are people like you with whom you can learn.

maybe someone would like to see the entire build and tweak it when it's done.

i have a few more features planned but i don't know if that would be possible.

greez

hey @ABG i have another questions, i want to display transactions details and there are static and non static components e.g. mutliple adresses and confirmed status with timestamp, height etc.
(https://mempool.space/api/tx/479ece7ac368efdd5977f1cc9fc589fbf9eeeb2a988077edda59ba009b0ce112)



i tried with these builds ((sortet) to do another api request but i get an error.
size yo.aia (11.5 KB)

I also wanted to ask whether it is possible to display details of a website when requested, i.e. only individual components, e.g. I call (https://amboss.space/node/02765a281bd188e80a89e6ea5092dcb8ebaaa5c5da341e64327e3fadbadcbc686c) using the search function.

is it possible for a label to change color when the number increased?

greez