Hey everyone,
I’ve hit a bit of a wall with a seemingly simple UI task and was hoping someone could point out what I’m missing.
The Goal:
I’m an indie dev working on my first game. As a fun little side-feature and a personal motivator, I’m trying to display my game’s local search ranking directly in the debug main menu. The idea is to see how my marketing efforts are paying off in my local city.
To get this data, I’m using a pretty cool localo seo tool I found. It has a free rank checker feature that lets me see my game’s website ranking on Google Maps, and I’m trying to pull that number via their API.
The Problem:
I’m having trouble getting the JSON data from the API call to update a Text Widget in my UMG. I can make the API call successfully and get a “200 OK” response, but the text on screen is always stuck at the default “Rank: 0”. I’m pretty sure I’m messing up the casting or the binding part in my Blueprint.
Here’s a rough outline of my Blueprint logic in the Widget Graph:
- OnConstruct: Trigger a custom event
FetchRankData
. - FetchRankData Event: Use the
VaRest
plugin to create aGET
request to the localo API endpoint. - OnRequestComplete (Bound Event):
- Check if the request was valid.
- Get Response Body (JSON Object).
- Try to get the
rank
field (which is an Integer).
. Here is where I think the problem is. I’m trying to get the field, convert it to Text, and set it to myRankText
widget, but it never seems to update. I’ve tried promoting the JSON object to a variable and accessing it from a binding function, but no luck either.
My Question:
Could the issue be with how I’m parsing the JSON, or is it a classic UMG binding problem?
Or maybe I’m completely misunderstanding the JSON structure that the tool provides. I’ve been trying to debug it for a while now. For anyone who’s curious about the kind of data I’m trying to parse, you can see how the tool works and what its output looks like here: I highly recommend you check out this free rank checker tool. It’s actually a great localo heatmap generator, and seeing the data structure might help you spot my mistake.
Any pointers or examples of correctly binding a nested JSON value to a text block would be a huge help!
Thanks in advance!