I have an API call that fetches data when a form is submitted. However, the response is not being set correctly and is returning null, even though I am setting the variables upon a successful call. I am also using a proxy for this request. Could there be something I'm doing wrong? What might be causing the response to return null?
Jacob Kofoed
2 months ago
Oct 6, 2024, 7:56 PM
The event doesnβt have the value (this will be fixed soon i believe), but you can get the data by picking your API in the formula and taking the data. You are guaranteed the data is there as the API just succeeded.
that makes sense. Is that only true for GET requests?
Erik Beuschau
2 months ago
Oct 7, 2024, 7:29 AM
The event will not hold the data for other types of requests either no
π₯1
Sam B
1 month ago
Oct 15, 2024, 9:47 AM
In my case, it's a POST request and I'm trying to fetch a value that I set in the API response. I try to set this value to a variable in toddle. But I always get null, is it because it's a POST request ? @Erik Beuschau@Jacob Kofoed
We don't treat POST requests differently from other methods. I don't think that's your issue. Perhaps you can share a url where we can investigate your issue? Often it's an anti-pattern to store a variable based on an API response - instead, it's often better to use the returned value from the request directly.