Updating page state from index 0 of a widget

Database & APIs

Hello,

I have a simple Supabase table with 2 colomns: "text" and "number of words".

I imported these data in a Carousel widget. I created a page state named "wordCount" for it to contain the number of words of the displayed text from the Carousel widget.

I created an action in the Carousel widget to update the "wordCount" page state with the "number of words" value depending on the carousel index, it works great! (You can find attached to this post a screenshot of this action)

The problem I encounter is that the page state updates only on Carousel page change, so when the page load and the Carousel is on the first page (index 0), the page state "wordCount" does not contain the value for the first displayed text in the Carousel.

I wrapped my head around this issue and could not find a solution to update the page state "wordCount" with a dynamic value on page load.

I'm brand new to Flutterflow so there is a high chance that I am missing something.

Any help is well welcomed, please let me know if something is unclear in this message!

Have a great day,

Yoann

What have you tried so far?

I tried to add the query to the root of the page to add an action on page load, but dynamic data is not visible in the action settings.

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