If I receive data in string format (I have already split the separators) and I receive a list like the one shown below, how do I do a select list item, because when I want to do it, it tells me that it is not a valid argument.
String example:
[“1749681227813”, “Botella”, “150”, “100”, “https://i.ibb.co/nqXYmMVF/f432e564f944.jpg ”, “166”]
If anyone has time and would like to guide me through the steps to assemble the blocks to create the select list item, I’d appreciate it. Thank you.
Glich
(Mahir Labib)
June 18, 2025, 2:21am
3
u should spitl at ,
and also how me your response data mean get value
Glich
(Mahir Labib)
June 18, 2025, 2:27am
5
one by one debug block to find error by “DO IT”
There are 2 debugging tags, for two different tables, I also need to select both lists to combine data.
Factor_Vital:
combine data.
Do you want to make it as single list?
I have a test DB, in which I have 2 tables, in the first I have ID, product, price, stock, and image. and in the second I have the ID, name and phone number. I want the IDs to be compared and as a result: the same ID (they share it in both tables) and the image, and they are combined with NAME and PHONE from table 2. I don’t know if I explained myself well. to capture this data in a cardview
Have you tried this extension?
Dear team, this is my another extension which works with lists though i found listutil extension and this will help you in many ways. Documentation is attached the with along with examples. So kindly go through with all the functions example and how it is working.
No libraries are added
No permission will request
No internet required
Summary
I like the DeepSearch function the most - It will search the specific item in all sort of list with any kind of index. Give Heart to this function. It t…
i believe you are having list of lists in your Db.
Extract the whole list, then by using the block FilterListOfListsByIndex
filter the lists then do what else you want
Glich
(Mahir Labib)
June 18, 2025, 4:35am
11
do you want to formate this
[
{
"id": "1749681227813",
"user_name": "manuel alejandro",
"user_phone": "1157222512",
"user_age": "67",
"product_name": "Botella",
"price": "150",
"stock": "100",
"image": "https://i.ibb.co/nqXYmMVF/f432e564f944.jpg",
"code": "166"
},
{
"id": "1749774030030",
"user_name": "alejandro molina",
"user_phone": "1127636541",
"user_age": "100",
"product_name": "miel",
"price": "1500",
"stock": "20",
"image": "https://ibb.co/1YbDHtx6/726d306ae6fd.jpg",
"code": "199"
},
{
"id": "1749946948757",
"product_name": "remera",
"price": "500",
"stock": "4",
"image": "https://i.ibb.co/DT654xq/7739944c3b25.jpg",
"code": "232"
}
]
The IDs from both tables must be combined, and the image must be extracted from table 1 and joined with the data from table 2.
Glich
(Mahir Labib)
June 18, 2025, 4:44am
13
Step-by-step guide to parse and format this in Kodular:
Step 1: Convert JSON to list
Use the Web Component or JSONTextDecode block to decode the outer array.
set rawData to get responseContent
set parsedList to JSONTextDecode rawData
Now parsedList
is:
["1749681227813", "Botella", "150", "100", "https://i.ibb.co/nqXYmMVF/f432e564f944.jpg", "166", "1749774030030", ...]
Step 2: Create lists to store data separately
In Kodular, create the following empty lists:
IDList
NameList
PriceList
StockList
ImageList
CodeList
Step 3: Loop through data
Use a for each number
loop from 1 to length of list
, step by 6 (because each item has 6 values):
for each number i from 1 to length of list parsedList by 6:
add item select list item list parsedList index i → to IDList
add item select list item list parsedList index i + 1 → to NameList
add item select list item list parsedList index i + 2 → to PriceList
add item select list item list parsedList index i + 3 → to StockList
add item select list item list parsedList index i + 4 → to ImageList
add item select list item list parsedList index i + 5 → to CodeList
Step 4: Now use these lists
You now have:
IDList = ["1749681227813", "1749774030030", "1749946948757"]
NameList = ["Botella", "miel", "remera"]
PriceList = ["150", "1 500", "500"]
StockList = ["100", "20", "4"]
ImageList = [URL1, URL2, URL3]
CodeList = ["166", "199", "232"]
Fix Potential Error: ["[ ... ]"]
is a string , not a list
If your database sends the data like:
["[\"1749681227813\", \"Botella\", ...]"]
Then you need to:
Get the first item from the list.
Decode that string as JSON again.
Example in Kodular:
set tempString to select list item list (JSONTextDecode responseContent) index 1
set finalList to JSONTextDecode tempString
Now finalList
will be the flat list of 18 items.
Final Structure for 3 Products (example)
do you want a Kodular block picture?
If you can and have the time, I’d love to. If not, what you’ve helped me with is perfect! Thanks!
.
1 Like