Query a JSON App Variable

Actions & Logic

I'm new to FlutterFlow and to Dart/Flutter for that matter. I'm loving it, but I've hit a snag.

I created a JSON list App Variable named "students". The format of the JSON list is:{"fname":"","lname":"","email":"","subject":""} For the sample build, I have about ten entries.

On the first page, there is a dropdown form field that is populated by the $.email of the App variable "students". This is passed to another page through a page parameter called "student".

On the second page I have a button and when the button is pressed it triggers an information dialog alert. For the message "value" of the alert, I need to create an action that queries the App Variable "students". I need to take the page parameter "student" and search the "students" App Variable for the match email record and then return the "fname" as a string in the message.

I don't know if I am overthinking this. I have been working on this for days.

On the second page where the info alert is displayed, I have an action created on the button. On the button action:
- I choose "App State" ->"students" JSON list variable
From there, I have tried several different ways of trying to filter and retrieve the correct entry, but I can't figure a way to do this.

Maybe, I'm not even doing it the correct way.

What have you tried so far?

I tried creating a custom function that returns the index value of the correct value in the App Variable "students". This way, I can just select the record with the index value but, from my understanding, Custom Functions can't access App Variables. Only custom actions can.

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