Sorting numbers in a list of objects (sharing)

While working with airtable REST API directly to download table sorted in way I wanted. I have to handle offsets, and download multiple pages, if the table have more than 100 rows… a real nightmare but it was done. However the blocks were messy and not elegant, but it is still better than assembling sorting algorithm with blocks to sort the list of objects by specific keys.

Then I found out I could use a quick cheat to simply use the Thunkable Airtable blocks to simple get the whole table and sort myself, well again using the sorting blocks. Found out that alphabet sorting also works for numbers. So this is my sharing. I couldn’t believe this just replaced my whole page of blocks and would have safe days used for working with REST API.

1 Like

there should be four join blocks in y in the top add y itself

No need. the top y is string joined by only the attribute to the key + spacer + thew entire json string of the object… Then I am building z, a list of such strings to utilise the sort list block. No need to add to itself.

Tested working well.

Note the divide by 1000, if the numbers expected to be sorted are larger than 4 digits, then you may divide with more zeros. intend was to make the pre-sort numbers all have the same order of magnitude. (because I am sorting ‘numbers’ with alphabet algo which reads/sort the first ‘digit’, and then ‘next’.)

1 Like

then can you tell what error is coming

Working fine and well. No error. Sharing a shortcut method I found useful.

so why you have added this in the thunkable discuss

Thunkable discuss is for sharing, exchange of ideas, helping each other, no? Thought this is a place not simply for asking questions? I made it clear in the title and in the texts within the first post. Sorry I have wasted your time.

" This space is dedicated for discussing anything related to the Thunkable ✕ Cross Platform (x.thunkable.com)"

yes it is but it is more of a tutorial i think and mostly thunkable discuss is for questions so i think this should be in thunkable tutorial

1 Like

I see. Thanks. @luv.ak.tech

If moderator is reading this, please help shift over. My bad.