Querying API and storing it as a double for later use

Database & APIs

Hi,

I'm new to FlutterFlow and right now, I'm trying to get an API to display values in a ListView. What I've done is run a query in the page and make the ListView populate containers for the paths that the API returns in the JSON. Now my question is how would it be possible to extract a certain value from all the paths, convert them into doubles(as FlutterFlow sees the JSON values as strings), and store them in a variable or list for use in calculations that I need later?

I have tried following this tutorial here: https://docs.flutterflow.io/data-and-backend/custom-data-types/custom-data-type-with-api, but I am very confused on how to get it working as I am querying the API call rather than running it in an action, and even when I do run it in an action, I get stuck on the step to update the app state since FlutterFlow won't let me store the value as it says "current variable is not valid".

I'm honestly not sure if this tutorial is the right way to do what I need (newbie) so that I can store multiple values from an API call in a variable as doubles so I can perform math on them. I would greatly appreciate help and/or advice on how to go about this.

Thank you so much in advance

PS: The images below show the JSON path where the numbers are the amount of containers being shown, and inside there is a grade that I need to store. In some scenarios the JSON won't always have exactly 7 paths. I also attached the variable not valid error(still not sure if that method is how to go about this), and then a picture of my UI if that helps.

Did you check FlutterFlow's Documentation for this topic?
Yes
3
3 replies