cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft
Microsoft

Incrementing a variable in a ForAll()

This is some code that is creating a collection

 

Set(
    Counter,
    0
);
ClearCollect(
    statusTable,
    'OneEng Candidates'.GeneralStatus
);
Collect(
    sortedTable,
    ""
);
Clear(sortedTable);
ForAll(
    statusTable,
    Collect(
        sortedTable,
        {
            status: ThisRecord.GeneralStatus,
            number: Counter+1
        }
    )
)

 

 

The collection looks like:

 

Screen Shot 2020-07-28 at 10.48.49 AM.png

However I want the counter to go up by 1 every time. Is there a way to increment the counter within the ForAll Loop in the above context? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

I don't have the answer for you, but I just ran into this video this morning and it seems it probably covers exactly what you are wanting to do.

 

https://youtu.be/oKJkVx2gehw



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

1 REPLY 1
Super User
Super User

I don't have the answer for you, but I just ran into this video this morning and it seems it probably covers exactly what you are wanting to do.

 

https://youtu.be/oKJkVx2gehw



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (83,647)