Read the mysql and display the value on the text box

Took @ABG 's advice, and reworked your json to include flag emojis (also removed the elements from the json that were not being used).

getCh2Emoji.aia (6.0 KB)

Thank you for both again. I will learn it in deep.

I know that there are country short names added on the JSON file, but I don't know how the App inventor makes emoji for the respective countries as I did not see the emoji block.

They may look like short codes, but they are in fact emojis as text.

The listview and label components convert these to display the image.

So what if I add a new country short name on Json, it will also show the new added country flag, right?

You will need to copy the "emoji text" for the country from the Country.json file ABG linked to above

You may also find this of use:

especially for those streams that do not work with the player component

May I know if the indexes on the following block point to the correct indexes on JSON?

  1. You will need to look at the list content generated by "values" to see what order the elements are in.

  2. I see you have not correctly copied the emoji textfor the flag,
    it should look like this: "flag": "πŸ‡ΊπŸ‡Έ"

Time to read up on dictionaries and JSON ...

It is safer to request by key than by position, which is not guaranteed.

The return order of values is stable (i.e. it doesn't change from one call to the next), but may change if new items are added to the json

I have made some changes on top of your AIA, as I put the flag emoji into MySQL and exported it to JSON, as it is easier for me to modify the list in the future. But I got the error when refreshing the screen below.


getCh4 New.aia (47.2 KB)

You are trying to get item 0 of your table.

A List Picker or ListView's SelectionIndex is 0 before you select something.

You somehow jumped the gun on your Selection process?

image

Turn off the Clock in the Designer.
It's like storing lit fireworks.

Thank you for fixing my problem. :laughing:

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