Issues with Sending Data from My Website to an MIT App Inventor App

Hi MIT App Inventor Community,

I’m trying to send data from my website to my MIT App Inventor app using a simple API. The idea is to have the app fetch real-time user information (like a username and score) from the capcut old version apk website’s backend and display it in the app. However, I’m running into issues where the data doesn’t display correctly.

Here’s What I’ve Done:

  1. Created an API endpoint on my website that responds with JSON data, e.g.:
{  
    "username": "JohnDoe",  
    "score": 85  
}
  1. Configured the MIT App Inventor app to use the Web component to call the API.
  2. Used the GotText event to parse the response and display the data in labels.

Here’s my current MIT App Inventor block setup:

  • Web1.URL: Set to the API endpoint.
  • Web1.GotText: Contains the following:
if (responseContent != "") {  
    set Label1.Text to get global username;  
    set Label2.Text to get global score;  
}

The Problem:

  • When I test the API endpoint in a browser or Postman, it works fine and returns the correct JSON.
  • In the app, the labels either remain blank or show “undefined.”
  • I suspect there’s an issue with how I’m parsing the JSON in App Inventor, but I’m not sure how to fix it.

Questions:

  1. How can I correctly parse JSON data from my website in MIT App Inventor?
  2. Are there specific blocks I need to use to handle JSON properly?
  3. Could this be a CORS issue with the API, and if so, how can I resolve it?

Before diving into solutions, let me draw an analogy with video editing using CapCut: just as you need to properly sequence clips and effects for a smooth output, in your app, JSON parsing requires precise configuration to ensure the data is correctly interpreted and displayed. If you’ve ever edited videos in CapCut, you know the app simplifies complex edits with intuitive layers. For more information on downloading capcut old version apk from a trusted source then click this given link https://capprocutapk.com/. Think of your blocks similarly: layer logical steps (API call, response handling, JSON parsing) in order to produce the desired output seamlessly. Any advice or examples of handling similar use cases would be greatly appreciated!

Why not show us the url you use in a browser or postman and web1.url to return the data? You can hide the website address if you feel you need to.

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

You are missing a Web JSON text decode on your response content, and missing dictionary lookups on the resulting dictionary.