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

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

This is the structure of your JSON output, using my Tidy utility:

+(dictionary)
 + fee
   + 721
 + locktime
   + 0
 + size
   + 223
 + status
   + +(dictionary)
   +  + block_hash
   +    + 000000000000000000124243532cec8ca84e24175cd097c9789522e010eb643a
   +  + block_height
   +    + 695349
   +  + block_time
   +    + 1628732062
   +  + confirmed
   +    + true
 + txid
   + 479ece7ac368efdd5977f1cc9fc589fbf9eeeb2a988077edda59ba009b0ce112
 + version
   + 1
 + vin
   + +(list)
   +  + +(dictionary)
   +  +  + is_coinbase
   +  +    + false
   +  +  + prevout
   +  +    + +(dictionary)
   +  +    +  + scriptpubkey
   +  +    +    + 00141ce75726e812b2fcaf36d6a178ccbfd58a5efcd6
   +  +    +  + scriptpubkey_address
   +  +    +    + bc1qrnn4wfhgz2e0etek66sh3n9l6k99alxk044mhr
   +  +    +  + scriptpubkey_asm
   +  +    +    + OP_0 OP_PUSHBYTES_20 1ce75726e812b2fcaf36d6a178ccbfd58a5efcd6
   +  +    +  + scriptpubkey_type
   +  +    +    + v0_p2wpkh
   +  +    +  + value
   +  +    +    + 523785755
   +  +  + scriptsig
   +  +    + 
   +  +  + scriptsig_asm
   +  +    + 
   +  +  + sequence
   +  +    + 4294967295
   +  +  + txid
   +  +    + 0a7aa65346b57ed077469526fe0a4ce7867c73803475b3eaf754e15281e8daf2
   +  +  + vout
   +  +    + 1
   +  +  + witness
   +  +    + +(list)
   +  +    +  + 3045022100977e0b562f152d791a5597c19e98db0972ffb5c69cd5573deccdc2b564669d2902203804b6252ceac9eeda8a4db00e3b0f6eb8ac67b7d2ec3f7a93d687e435673e1501
   +  +    +  + 021b7f2cb05643404c57d0587b48c8d882a454f1040c47cbd31c73d29b599d0401
 + vout
   + +(list)
   +  + +(dictionary)
   +  +  + scriptpubkey
   +  +    + 00143b796e64a909eaf8c2d692e19dd187c4cf3157c1
   +  +  + scriptpubkey_address
   +  +    + bc1q8dukue9fp8403skkjtsem5v8cn8nz47p43pete
   +  +  + scriptpubkey_asm
   +  +    + OP_0 OP_PUSHBYTES_20 3b796e64a909eaf8c2d692e19dd187c4cf3157c1
   +  +  + scriptpubkey_type
   +  +    + v0_p2wpkh
   +  +  + value
   +  +    + 1262459
   +  + +(dictionary)
   +  +  + scriptpubkey
   +  +    + 00141ce75726e812b2fcaf36d6a178ccbfd58a5efcd6
   +  +  + scriptpubkey_address
   +  +    + bc1qrnn4wfhgz2e0etek66sh3n9l6k99alxk044mhr
   +  +  + scriptpubkey_asm
   +  +    + OP_0 OP_PUSHBYTES_20 1ce75726e812b2fcaf36d6a178ccbfd58a5efcd6
   +  +  + scriptpubkey_type
   +  +    + v0_p2wpkh
   +  +  + value
   +  +    + 522522575
 + weight
 + 562

Since the runtime error was about finding "size" instead of an index, that means you were using a list select item block instead of a lookup key in dict block. Since "size" is a top level tag, that should be very straightforward.
blocks

Regarding web site scraping, here is a sample app:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.