Read :
Hey, I dont know. Im looking for answers myself
You have had many useful examples provided. You have asked this question on the App Inventor forum as well. Here are some blocks following the worded answer you received there. I have only written out 7 (seven) elements in the string, and set the outputs to labels, you can modify this example to save to tinydb tags (Would be better to save the list to a single tag, in my opinion). Apologies to Kodular users/mods for the AI2 blocks
This should resolve your issue.
Once you have your string converted to a list, you have all your outputs “in a variable”.
Example SQL string returned:
((8 22 2020-12-13 $first_name $last_name $E8_9 $E9_10))
As suggested on the App Inventor forum:
Use text replacement blocks to remove the parentheses (())
Convert what remains to a list using the text split by spaces block
Select each item from the list and assign to your chosen variables
In future, and as advised several times by me and others, if you are developing in a particular builder, please ask your questions in the builder that you are using, because the builders (App Inventor, Kodular, etc.) are becoming more different day by day and an answer given on for one builder may not apply or work on another.
You may also want to do some learning about lists:
- Lists by Sajal Dutta
- Lists appinventor.org
Thanks for doing all that work. I really do appreciate it.
The above is the error message I get on my device.
I’m assuming it’s related to the the (expectation of a number) as per the blocks but yours returns data so I’ve obviously done something wrong.
Whats Wrong?
Thanks
t
The message shows that you have passed a URL. And see that you passed the variable that contains the URL. This is not the variable you must pass.
global get_SQL_DATA is wrong.
Change to alarm_list.
In its place, put that variable that received the response content there in your first post. (alarm_list)
This variable that contains your return.
See your for each block.
1
SQLList
1
What you see ?
And message error, what you see in the error message?
So I changed it to [Item} and still it bombed
For Range : The end value is not a number???
Im loosing it1
What does the For Each block do ?
What are the 3 parameters of this block ?
1
SQLList
1
It goes tru the returned data one step at a time for the amt of data returned
Yes, and that was why I changed it to [Item} but still no luck?
Now it says - Select List item
: List index too large Select list item: Attempt to get item number 10 of a list of length 9???
but it wrote the returned values into the variables from the database which is fantastic
2 list with diferent sizes ?
The list he gave as an example was just … an example … you don’t need it …
but he was correct. I only need 9 items
$values = mysqli_query($dbc, "SELECT info_8_desc, (1)
info_9_desc, (2)
info_10_desc, (3)
info_11_desc, (4)
info_12_desc, (5)
info_13_desc, (6)
info_14_desc, (7)
info_15_desc, (8)
info_16_desc (9)
FROM info WHERE
node_id = ‘$Node_id’ AND info_date=’$Info_Date’ ");
Friend, if there is an error message saying you are trying to access the 10th element if there is only 9, please check your algorithm.
@TimAi2 has already given you the solution.
He gave you ready blocks.
He gave you links.
Please show what comes back in responseContent before you do anything with it.
Hey Guys, A big Shout out to Tim, Roderio and other for helping this old guy. Luckily I don’t see myself doing any more apps after this one so thanks again. I really appreciate everyone’s efforts to see me tough this one. Thanks again.