ย ยทย White-label tech consultant

How to Manage Index Position in an App-Wide Action Block Loop in FlutterFlow?

Actions & Logic

Hi FlutterFlow Community,

I'm trying to create an app-wide action block in FlutterFlow that involves a loop to add entries to a list in a Firebase document.

The loop needs to:

  1. Add X entries of type A.

  2. Add Y entries of type B.

*A and B are enums. X and Y are variables. It needs to be ordered as in AAABB.

Since this is an app-wide action block, I can't use a local page variable for the index. I need to track the index position within the loop.

How can I manage the index position in this loop? Is there a way to use global variables or another method to keep track of the current loop index?

Any detailed steps or guidance would be greatly appreciated!

Thanks!

What have you tried so far?

I read that local page variables can be used, but they don't seem to fit this scenario.

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