Hey everyone
Just wanted to share a quick issue I ran into with FlutterFlow’s API Call section, in case it helps someone else.
I was working with a simple GET
API where I needed to pass a dynamic user_id
in the URL, like this:
https://api.example.com/data?user={{user_id}}
In the Test API Call section, everything worked perfectly. But once I tried using it in my actual app, the API kept returning no data. After checking the request logs, I noticed that it was sending user=null
even though I was sure I passed the correct value from a text field or app state.
Super confusing.
The weird part?
It only happened when I used the API inside a FutureBuilder or as a data source on page load. If I called it directly through a button action, it worked fine.
What worked for me:
I ended up creating a custom function that called the API manually, passing in the dynamic user_id
from a variable. Then I triggered it either on page load or via a button.
Once I did that, the correct values were sent and everything loaded properly. So it seems like there’s a bug with how dynamic variables bind inside API calls when used in a FutureBuilder or without an explicit trigger.
Anyway, just a heads up if your API seems broken but works in the test tab it might not be your fault. Try triggering the call manually and passing values that way.
Hope this helps someone!